Release v1.0.4 merge.
This commit is contained in:
commit
a8e7a3dcb0
179 changed files with 4602 additions and 338 deletions
|
@ -4,4 +4,4 @@ org.gradle.jvmargs=-Xmx8G
|
|||
version_minecraft=1.12.2
|
||||
version_forge=14.23.5.2768
|
||||
version_jei=4.10.0.198
|
||||
version_engineersdecor=1.0.3
|
||||
version_engineersdecor=1.0.4
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
{
|
||||
"homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/",
|
||||
"1.12.2": {
|
||||
"1.0.4": "[R] Release based on v1.0.3-b9. Release-to-release changes: * Crafting table: Quick crafting history re-fab, JEI integration. * Rendering improvements and issue fixes (stairs, ambient occlusion, optifine, etc). * Walls with texture variations. * Thin/thick steel poles with support feet/heads. * Horizontal steel double-T support beams added. * Fluid pipe valves added: Check valve, redstone controlled valve, analog redstone controlled valve. Support pressuzized transfer. * Tooltip documentation (CTRL-SHIFT) for stairs added. * Internal code cleanups. * Recipes tuned.\n[E] Added pass-through electrical furnace (experimental, see config).",
|
||||
"1.0.4-b9": "[F] Inserting fluids with pressurized tag only into IE piping.\n[F] Valve redstone connector rendering does not check for \"can connect redstone\" but only for \"can provide power\".\n[M] Valves are adapted to be detected as pipe by IE.",
|
||||
"1.0.4-b8": "[F] Fixed stairs rendering without smooth light (thanks rastot9).\n[E] Added passive fluid accumulator (experimental feature, see config).",
|
||||
"1.0.4-b7": "[F] Fixed recipe loading issue if IE is not installed.\n[M] Valves support IE pressurized fluid transfer.",
|
||||
"1.0.4-b6": "[A] Added redstone controlled fluid valve.\n[A] Added redstone controlled analog fluid valve.\n[M] Check valve recipe adapted (thanks majijn).",
|
||||
"1.0.4-b5": "[A] Horizontal steel double-T support beam with pole connections.\n[A] Added fluid pipe check valve (straight, conducts only one way).\n[M] Internal registration block/te handling changed.",
|
||||
"1.0.4-b4": "[F] Clinker/slag brick wall side cullfacing disabled to prevent texture leaks when connecting to concrete walls.\n[F] Unused treated wood pole texture regions filled (optifine).\n[F] Using mipped cutout format for window multi-layer model (issue #19, thanks rixmswey for reporting and details).\n[M] Recipe tuning, added standalone recipe for all mod blocks.\n[M] In-game CTRL-SHIFT tooltip documentation updated.\n[M] Panzer glass block: Ambient occlusion and light opacity tuned.\n[M] Stairs: Light opacity tuned.\n[A] Tooltip documentation added for mod stairs.\n[E] Horizontal steel double-T support beam (config:experimental).",
|
||||
"1.0.4-b3": "[A] Added thin (4x4x16) and thick (6x6x16) steel hollow poles.\n[A] Added support head/foot components for thin and thick steel poles.",
|
||||
"1.0.4-b2": "[A] Added position dependent texture variation to clinker wall, slag brick wall and rebar concrete wall.",
|
||||
"1.0.4-b1": "[A] Crafting table: JEI integration for recipe placement added.\n[A] Crafting table: History re-fab added, allowing to quickly select and re-craft recent recipes. Selection with arrow buttons, ingredient placement by clicking the result slot. Automatic item distribution on shift-click. Quick-move buttons.\n[F] Crafting table textures modified to prevent optifine glitches on the edges of the legs.",
|
||||
"1.0.3": "[R] Release based on v1.0.3-b5. Release-to-release changes: * Small laboratory furnace added. * Extensive config options for mod packing and tuning added. * Rendering issues fixes (window bleeding, optifine). * Steel framed window added. * Treated wood pole \"end pieces\" added (two support variants). * Sitting on treated wood stool added including mobs (but not villagers, as these are obviously very upright people). * Lang ru_ru added (github contribution from Yaroslavik). * Creative tab logo changed to mod logo. * Table/crafting table bounding boxes refined. * Standalone \"escape\" recipes added if IE is not installed.",
|
||||
"1.0.3-b5": "[F] Fixed typo in en-en lang file.\n[F] Fixed IE concrete texture missing bailout in log if IE is not installed.\n[F] Using forge multi-layer models for windows to circumvent glitches.\n[M] Changed creative tab logo to the mod logo.\n[A] Added alternative recipes for crafting table and furnace if main IE ingredients are missing (for \"stand-alone\" mod usage).",
|
||||
"1.0.3-b4": "[A] Lab furnace supports electrical speedup when a IE external is placed in one of the two auxiliary slots.\n[F] Fixed window rendering issue (issue #15, thanks to ILLOMIURGE).\n[M] Updated ru_ru lang file (Yaroslavik).",
|
||||
|
@ -23,7 +33,7 @@
|
|||
"1.0.0-b1": "[A] Initial structure.\n[A] Added clinker bricks and clinker brick stairs.\n[A] Added slag bricks and slag brick stairs.\n[A] Added metal rung ladder.\n[A] Added staggered metal steps ladder.\n[A] Added treated wood ladder.\n[A] Added treated wood pole.\n[A] Added treated wood table."
|
||||
},
|
||||
"promos": {
|
||||
"1.12.2-recommended": "1.0.3",
|
||||
"1.12.2-latest": "1.0.3"
|
||||
"1.12.2-recommended": "1.0.4",
|
||||
"1.12.2-latest": "1.0.4"
|
||||
}
|
||||
}
|
|
@ -10,6 +10,67 @@ Mod sources for Minecraft version 1.12.2.
|
|||
----
|
||||
## Revision history
|
||||
|
||||
-------------------------------------------------------------------
|
||||
- v1.0.4 [R] Release based on v1.0.3-b9. Release-to-release changes:
|
||||
* Crafting table: Quick crafting history re-fab, JEI integration.
|
||||
* Rendering improvements and issue fixes (stairs, ambient occlusion,
|
||||
optifine, etc).
|
||||
* Walls with texture variations.
|
||||
* Thin/thick steel poles with support feet/heads.
|
||||
* Horizontal steel double-T support beams added.
|
||||
* Fluid pipe valves added: Check valve, redstone controlled valve,
|
||||
analog redstone controlled valve. Support pressuzized transfer.
|
||||
* Tooltip documentation (CTRL-SHIFT) for stairs added.
|
||||
* Internal code cleanups.
|
||||
* Recipes tuned.
|
||||
-------------------------------------------------------------------
|
||||
[E] Added pass-through electrical furnace (experimental, see config).
|
||||
|
||||
- v1.0.4-b9 [F] Inserting fluids with pressurized tag only into IE piping.
|
||||
[F] Valve redstone connector rendering does not check for
|
||||
"can connect redstone" but only for "can provide power".
|
||||
[M] Valves are adapted to be detected as pipe by IE.
|
||||
|
||||
- v1.0.4-b8 [F] Fixed stairs rendering without smooth light (thanks rastot9).
|
||||
[E] Added passive fluid accumulator (experimental feature, see config).
|
||||
|
||||
- v1.0.4-b7 [F] Fixed recipe loading issue if IE is not installed.
|
||||
[M] Valves support IE pressurized fluid transfer.
|
||||
|
||||
- v1.0.4-b6 [A] Added redstone controlled fluid valve.
|
||||
[A] Added redstone controlled analog fluid valve.
|
||||
[M] Check valve recipe adapted (thanks majijn).
|
||||
|
||||
- v1.0.4-b5 [A] Horizontal steel double-T support beam with pole connections.
|
||||
[A] Added fluid pipe check valve (straight, conducts only one way).
|
||||
[M] Internal registration block/te handling changed.
|
||||
|
||||
- v1.0.4-b4 [F] Clinker/slag brick wall side cullfacing disabled to prevent
|
||||
texture leaks when connecting to concrete walls.
|
||||
[F] Unused treated wood pole texture regions filled (optifine).
|
||||
[F] Using mipped cutout format for window multi-layer model
|
||||
(issue #19, thanks rixmswey for reporting and details).
|
||||
[M] Recipe tuning, added standalone recipe for all mod blocks.
|
||||
[M] In-game CTRL-SHIFT tooltip documentation updated.
|
||||
[M] Panzer glass block: Ambient occlusion and light opacity tuned.
|
||||
[M] Stairs: Light opacity tuned.
|
||||
[A] Tooltip documentation added for mod stairs.
|
||||
[E] Horizontal steel double-T support beam (config:experimental).
|
||||
|
||||
- v1.0.4-b3 [A] Added thin (4x4x16) and thick (6x6x16) steel hollow poles.
|
||||
[A] Added support head/foot components for thin and thick steel poles.
|
||||
|
||||
- v1.0.4-b2 [A] Added position dependent texture variation to clinker wall,
|
||||
slag brick wall and rebar concrete wall.
|
||||
|
||||
- v1.0.4-b1 [A] Crafting table: JEI integration for recipe placement added.
|
||||
[A] Crafting table: History re-fab added, allowing to quickly select
|
||||
and re-craft recent recipes. Selection with arrow buttons,
|
||||
ingredient placement by clicking the result slot. Automatic
|
||||
item distribution on shift-click. Quick-move buttons.
|
||||
[F] Crafting table textures modified to prevent optifine glitches
|
||||
on the edges of the legs.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
- v1.0.3 [R] Release based on v1.0.3-b5. Release-to-release changes:
|
||||
* Small laboratory furnace added.
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* BluSunrize
|
||||
* Copyright (c) 2017
|
||||
*
|
||||
* This code is licensed under "Blu's License of Common Sense"
|
||||
* Details can be found in the license file in the root folder of this project
|
||||
*/
|
||||
|
||||
package blusunrize.immersiveengineering.api.fluid;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public interface IFluidPipe
|
||||
{
|
||||
boolean canOutputPressurized(boolean consumePower);
|
||||
|
||||
boolean hasOutputConnection(EnumFacing side);
|
||||
}
|
|
@ -8,11 +8,10 @@
|
|||
*/
|
||||
package wile.engineersdecor;
|
||||
|
||||
import wile.engineersdecor.detail.ModConfig;
|
||||
import wile.engineersdecor.detail.ExtItems;
|
||||
import wile.engineersdecor.detail.Networking;
|
||||
import wile.engineersdecor.detail.RecipeCondModSpecific;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import wile.engineersdecor.detail.*;
|
||||
import wile.engineersdecor.blocks.*;
|
||||
import wile.engineersdecor.items.*;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
|
@ -39,6 +38,7 @@ import net.minecraftforge.event.RegistryEvent;
|
|||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
|
@ -126,12 +126,16 @@ public class ModEngineersDecor
|
|||
|
||||
@SubscribeEvent
|
||||
public static void registerItems(final RegistryEvent.Register<Item> event)
|
||||
{ ModBlocks.registerItemBlocks(event); }
|
||||
{ ModBlocks.registerItemBlocks(event); ModItems.registerItems(event); }
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerRecipes(RegistryEvent.Register<IRecipe> event)
|
||||
{ ModRecipes.registerRecipes(event); }
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public static void registerModels(final ModelRegistryEvent event)
|
||||
{ ModBlocks.initModels(); }
|
||||
{ ModBlocks.initModels(); ModItems.initModels(); }
|
||||
}
|
||||
|
||||
public static final CreativeTabs CREATIVE_TAB_ENGINEERSDECOR = (new CreativeTabs("tabengineersdecor") {
|
||||
|
@ -149,6 +153,7 @@ public class ModEngineersDecor
|
|||
{
|
||||
public static final int GUIID_CRAFTING_TABLE = 213101;
|
||||
public static final int GUIID_SMALL_LAB_FURNACE = 213102;
|
||||
public static final int GUIID_ELECTRICAL_LAB_FURNACE = 213103;
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(final int guiid, final EntityPlayer player, final World world, int x, int y, int z)
|
||||
|
@ -158,6 +163,7 @@ public class ModEngineersDecor
|
|||
switch(guiid) {
|
||||
case GUIID_CRAFTING_TABLE: return BlockDecorCraftingTable.getServerGuiElement(player, world, pos, te);
|
||||
case GUIID_SMALL_LAB_FURNACE: return BlockDecorFurnace.getServerGuiElement(player, world, pos, te);
|
||||
case GUIID_ELECTRICAL_LAB_FURNACE: return BlockDecorFurnaceElectrical.getServerGuiElement(player, world, pos, te);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -171,6 +177,7 @@ public class ModEngineersDecor
|
|||
switch(guiid) {
|
||||
case GUIID_CRAFTING_TABLE: return BlockDecorCraftingTable.getClientGuiElement(player, world, pos, te);
|
||||
case GUIID_SMALL_LAB_FURNACE: return BlockDecorFurnace.getClientGuiElement(player, world, pos, te);
|
||||
case GUIID_ELECTRICAL_LAB_FURNACE: return BlockDecorFurnaceElectrical.getClientGuiElement(player, world, pos, te);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -9,13 +9,14 @@
|
|||
* - MC block defaults.
|
||||
* - Tooltip functionality
|
||||
* - Model initialisation
|
||||
* - Accumulating "deprecated" warnings from Block where "overriding/implementing is fine".
|
||||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.util.*;
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.detail.ModAuxiliaries;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.EnumPushReaction;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -25,8 +26,8 @@ import net.minecraft.world.IBlockAccess;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
@ -48,10 +49,13 @@ public class BlockDecor extends Block
|
|||
public static final long CFG_FACING_PLACEMENT = 0x0000000000000008L; // placed on the facing the player has clicked.
|
||||
public static final long CFG_OPPOSITE_PLACEMENT = 0x0000000000000010L; // placed placed in the opposite direction of the face the player clicked.
|
||||
public static final long CFG_FLIP_PLACEMENT_IF_SAME = 0x0000000000000020L; // placement direction flipped if an instance of the same class was clicked
|
||||
public static final long CFG_TRANSLUCENT = 0x0000000000000040L; // indicates a block/pane is glass like (transparent, etc)
|
||||
public static final long CFG_FLIP_PLACEMENT_SHIFTCLICK = 0x0000000000000040L; // placement direction flipped if player is sneaking
|
||||
public static final long CFG_TRANSLUCENT = 0x0000000000000080L; // indicates a block/pane is glass like (transparent, etc)
|
||||
public static final long CFG_LIGHT_VALUE_MASK = 0x0000000000000f00L; // fixed value for getLightValue()
|
||||
public static final long CFG_LIGHT_VALUE_SHIFT = 8L;
|
||||
public static final long CFG_LAB_FURNACE_CRUDE = 0x0000000000010000L; // For DecorFurnace, denotes that it is a crude furnace.
|
||||
public static final long CFG_ELECTRICAL = 0x0000000000010000L; // Denotes if a component is mainly flux driven.
|
||||
public static final long CFG_REDSTONE_CONTROLLED = 0x0000000000020000L; // Denotes if a component has somehow a redstone control input
|
||||
public static final long CFG_ANALOG = 0x0000000000040000L; // Denotes if a component has analog behaviour
|
||||
|
||||
protected final AxisAlignedBB aabb;
|
||||
|
||||
|
@ -89,6 +93,11 @@ public class BlockDecor extends Block
|
|||
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
{ return true; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing face)
|
||||
{ return BlockFaceShape.SOLID; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isFullCube(IBlockState state)
|
||||
|
@ -156,37 +165,18 @@ public class BlockDecor extends Block
|
|||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{ return aabb; }
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("deprecation")
|
||||
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos)
|
||||
{ return state.getBoundingBox(worldIn, pos).offset(pos); }
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
|
||||
{}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
public void onBlockClicked(World world, BlockPos pos, EntityPlayer player)
|
||||
{}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos)
|
||||
{}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{ return (int)((config & CFG_LIGHT_VALUE_MASK) >> CFG_LIGHT_VALUE_SHIFT); }
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side)
|
||||
{ return super.canPlaceBlockOnSide(world, pos, side); }
|
||||
|
||||
@Override
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand)
|
||||
{ return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand); }
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -21,7 +22,6 @@ import net.minecraft.util.math.AxisAlignedBB;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import net.minecraft.client.gui.GuiButtonImage;
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.detail.Networking;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -25,6 +25,8 @@ import net.minecraft.inventory.*;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
|
@ -37,10 +39,12 @@ import net.minecraft.client.renderer.RenderHelper;
|
|||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiButtonImage;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import wile.engineersdecor.detail.Networking;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
|
@ -51,10 +55,14 @@ import java.util.List;
|
|||
public class BlockDecorCraftingTable extends BlockDecorDirected
|
||||
{
|
||||
public static boolean with_assist = true;
|
||||
public static boolean with_assist_direct_history_refab = false;
|
||||
public static boolean with_assist_quickmove_buttons = false;
|
||||
|
||||
public static final void on_config(boolean without_crafting_assist)
|
||||
public static final void on_config(boolean without_crafting_assist, boolean with_assist_immediate_history_refab, boolean with_quickmove_buttons)
|
||||
{
|
||||
with_assist = !without_crafting_assist;
|
||||
with_assist_direct_history_refab = with_assist_immediate_history_refab;
|
||||
with_assist_quickmove_buttons = with_quickmove_buttons;
|
||||
CraftingHistory.max_history_size(32);
|
||||
}
|
||||
|
||||
|
@ -157,11 +165,15 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
|
||||
private static class CraftingHistory
|
||||
{
|
||||
public static final int RESULT_STACK_INDEX = 0;
|
||||
public static final int INPUT_STACKS_BEGIN = 1;
|
||||
public static final List<ItemStack> NOTHING = new ArrayList<ItemStack>();
|
||||
private static int max_history_size_ = 5;
|
||||
|
||||
private List<String> history_ = new ArrayList<String>();
|
||||
private int current_ = -1;
|
||||
private static int max_history_size_ = 5;
|
||||
private List<ItemStack> current_stacks_ = new ArrayList<ItemStack>();
|
||||
private IRecipe current_recipe_ = null;
|
||||
|
||||
public CraftingHistory()
|
||||
{}
|
||||
|
@ -186,6 +198,7 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
}
|
||||
}
|
||||
current_ = (!subsect.hasKey("current")) ? (-1) : MathHelper.clamp(subsect.getInteger("current"), -1, history_.size()-1);
|
||||
update_current();
|
||||
} catch(Throwable ex) {
|
||||
ModEngineersDecor.logger.error("Exception reading crafting table history NBT, resetting, exception is:" + ex.getMessage());
|
||||
clear();
|
||||
|
@ -201,27 +214,39 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
}
|
||||
|
||||
public void clear()
|
||||
{ current_ = -1; history_.clear(); }
|
||||
{ reset_current(); history_.clear(); }
|
||||
|
||||
public void reset_curent()
|
||||
{ current_ = -1; }
|
||||
public void reset_current()
|
||||
{ current_ = -1; current_stacks_ = NOTHING; current_recipe_ = null; }
|
||||
|
||||
public void add(final List<ItemStack> grid_stacks)
|
||||
void update_current()
|
||||
{
|
||||
if(!with_assist) { clear(); return; }
|
||||
String s = stacks2str(grid_stacks);
|
||||
if(s.isEmpty()) return;
|
||||
history_.removeIf(e->e.equals(s));
|
||||
history_.add(s);
|
||||
while(history_.size() > max_history_size()) history_.remove(0);
|
||||
if(current_ >= history_.size()) current_ = -1;
|
||||
if((current_ < 0) || (current_ >= history_.size())) { reset_current(); return; }
|
||||
Tuple<IRecipe, List<ItemStack>> data = str2stacks(history_.get(current_));
|
||||
if(data == null) { reset_current(); return; }
|
||||
current_recipe_ = data.getFirst();
|
||||
current_stacks_ = data.getSecond();
|
||||
}
|
||||
|
||||
public String stacks2str(final List<ItemStack> grid_stacks)
|
||||
public void add(final List<ItemStack> grid_stacks, IRecipe recipe)
|
||||
{
|
||||
if((grid_stacks==null) || (grid_stacks.size() != 10)) return "";
|
||||
if(!with_assist) { clear(); return; }
|
||||
String s = stacks2str(grid_stacks, recipe);
|
||||
String recipe_filter = recipe.getRegistryName().toString() + ";";
|
||||
if(s.isEmpty()) return;
|
||||
history_.removeIf(e->e.equals(s));
|
||||
history_.removeIf(e->e.startsWith(recipe_filter));
|
||||
history_.add(s);
|
||||
while(history_.size() > max_history_size()) history_.remove(0);
|
||||
if(current_ >= history_.size()) reset_current();
|
||||
}
|
||||
|
||||
public String stacks2str(final List<ItemStack> grid_stacks, IRecipe recipe)
|
||||
{
|
||||
if((grid_stacks==null) || (grid_stacks.size() != 10) || (recipe==null)) return "";
|
||||
if(grid_stacks.get(0).isEmpty()) return "";
|
||||
final ArrayList<String> items = new ArrayList<String>();
|
||||
items.add(recipe.getRegistryName().toString().trim());
|
||||
for(ItemStack st:grid_stacks) {
|
||||
int meta = st.getMetadata();
|
||||
items.add( (st.isEmpty()) ? ("") : ((st.getItem().getRegistryName().toString().trim()) + ((meta==0)?(""):("/"+meta)) ));
|
||||
|
@ -229,13 +254,21 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
return String.join(";", items);
|
||||
}
|
||||
|
||||
public List<ItemStack> str2stacks(final String entry)
|
||||
public @Nullable Tuple<IRecipe, List<ItemStack>> str2stacks(final String entry)
|
||||
{
|
||||
try {
|
||||
if((entry == null) || (entry.isEmpty())) return NOTHING;
|
||||
if((entry == null) || (entry.isEmpty())) return null;
|
||||
ArrayList<String> item_regnames = new ArrayList<String>(Arrays.asList(entry.split("[;]")));
|
||||
if((item_regnames == null) || (item_regnames.size() > 10)) return NOTHING;
|
||||
while(item_regnames.size() < 10) item_regnames.add("");
|
||||
if((item_regnames == null) || (item_regnames.size() < 2) || (item_regnames.size() > 11)) return null;
|
||||
while(item_regnames.size() < 11) item_regnames.add("");
|
||||
IRecipe recipe = null;
|
||||
try {
|
||||
final IForgeRegistry<IRecipe> recipe_registry = GameRegistry.findRegistry(IRecipe.class);
|
||||
recipe = recipe_registry.getValue(new ResourceLocation(item_regnames.remove(0)));
|
||||
} catch(Throwable e) {
|
||||
ModEngineersDecor.logger.error("Recipe lookup failed: " + e.getMessage());
|
||||
}
|
||||
if(recipe==null) return null;
|
||||
List<ItemStack> stacks = new ArrayList<ItemStack>();
|
||||
for(String regname : item_regnames) {
|
||||
ItemStack stack = ItemStack.EMPTY;
|
||||
|
@ -244,42 +277,54 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
if(regname.indexOf('/') >= 0) {
|
||||
String[] itemdetails = regname.split("[/]");
|
||||
if(itemdetails.length>0) regname = itemdetails[0];
|
||||
try { if(itemdetails.length>1) meta = Integer.parseInt(itemdetails[1]); } catch(Throwable e){meta=0;} // ignore exception here
|
||||
if(itemdetails.length>1) try { meta=Integer.parseInt(itemdetails[1]); } catch(Throwable e){ meta=0; } // ignore exception here
|
||||
}
|
||||
final Item item = Item.REGISTRY.getObject(new ResourceLocation(regname));
|
||||
stack = ((item == null) || (item == Items.AIR)) ? ItemStack.EMPTY : (new ItemStack(item, 1, meta));
|
||||
}
|
||||
stacks.add(stack);
|
||||
}
|
||||
if((stacks.size() != 10) || (stacks.get(0).isEmpty())) return NOTHING; // invalid size or no result
|
||||
return stacks;
|
||||
if((stacks.size() != 10) || (stacks.get(0).isEmpty())) return null; // invalid size or no result
|
||||
return new Tuple<IRecipe, List<ItemStack>>(recipe, stacks);
|
||||
} catch(Throwable ex) {
|
||||
ModEngineersDecor.logger.error("History stack building failed: " + ex.getMessage());
|
||||
return NOTHING;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public List<ItemStack> current()
|
||||
{
|
||||
if((current_ < 0) || (current_ >= history_.size())) { current_ = -1; return NOTHING; }
|
||||
return str2stacks(history_.get(current_));
|
||||
}
|
||||
{ return current_stacks_; }
|
||||
|
||||
public IRecipe current_recipe()
|
||||
{ return current_recipe_; }
|
||||
|
||||
public void next()
|
||||
{
|
||||
if(history_.isEmpty()) { current_ = -1; return; }
|
||||
current_ = ((++current_) >= history_.size()) ? (-1) : (current_);
|
||||
if(history_.isEmpty()) {
|
||||
current_ = -1;
|
||||
} else {
|
||||
current_ = ((++current_) >= history_.size()) ? (-1) : (current_);
|
||||
}
|
||||
update_current();
|
||||
}
|
||||
|
||||
public void prev()
|
||||
{
|
||||
if(history_.isEmpty()) { current_ = -1; return; }
|
||||
current_ = ((--current_) < -1) ? (history_.size()-1) : (current_);
|
||||
if(history_.isEmpty()) {
|
||||
current_ = -1;
|
||||
} else {
|
||||
current_ = ((--current_) < -1) ? (history_.size()-1) : (current_);
|
||||
}
|
||||
update_current();
|
||||
}
|
||||
|
||||
public void reset_selection()
|
||||
{ current_ = -1; update_current(); }
|
||||
|
||||
public String toString()
|
||||
{
|
||||
StringBuilder s = new StringBuilder("{ current:" + current_ + ", elements:[ ");
|
||||
String rec = (current_recipe_==null) ? "none" : (current_recipe_.getRegistryName().toString());
|
||||
StringBuilder s = new StringBuilder("{ current:" + current_ + ", recipe:'" + rec + "', elements:[ ");
|
||||
for(int i=0; i<history_.size(); ++i) s.append("{i:").append(i).append(", e:[").append(history_.get(i)).append("]} ");
|
||||
s.append("]}");
|
||||
return s.toString();
|
||||
|
@ -296,16 +341,22 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
{
|
||||
protected static final int BUTTON_NEXT = 0;
|
||||
protected static final int BUTTON_PREV = 1;
|
||||
protected static final int BUTTON_FROM_STORAGE = 2;
|
||||
protected static final int BUTTON_TO_STORAGE = 3;
|
||||
protected static final int BUTTON_FROM_PLAYER = 4;
|
||||
protected static final int BUTTON_TO_PLAYER = 5;
|
||||
protected static final int BUTTON_CLEAR_GRID = 2;
|
||||
protected static final int BUTTON_FROM_STORAGE = 3;
|
||||
protected static final int BUTTON_TO_STORAGE = 4;
|
||||
protected static final int BUTTON_FROM_PLAYER = 5;
|
||||
protected static final int BUTTON_TO_PLAYER = 6;
|
||||
protected static final int ACTION_PLACE_CURRENT_HISTORY_SEL = 7;
|
||||
protected static final int ACTION_PLACE_SHIFTCLICKED_STACK = 8;
|
||||
|
||||
protected static final ResourceLocation BACKGROUND = new ResourceLocation(ModEngineersDecor.MODID, "textures/gui/treated_wood_crafting_table.png");
|
||||
protected final BTileEntity te;
|
||||
protected final EntityPlayer player;
|
||||
protected final ArrayList<GuiButton> buttons = new ArrayList<GuiButton>();
|
||||
protected final boolean history_slot_tooltip[] = {false,false,false,false,false,false,false,false,false,false};
|
||||
|
||||
public BGui(InventoryPlayer playerInventory, World world, BlockPos pos, BTileEntity te)
|
||||
{ super(new BContainer(playerInventory, world, pos, te)); this.te = te; }
|
||||
{ super(new BContainer(playerInventory, world, pos, te)); this.te = te; this.player=playerInventory.player; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unused")
|
||||
|
@ -315,12 +366,15 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
final int x0=((width - xSize)/2), y0=((height - ySize)/2);
|
||||
buttons.clear();
|
||||
if(with_assist) {
|
||||
buttons.add(addButton(new GuiButtonImage(BUTTON_NEXT, x0+156,y0+44, 12,12, 194,44, 12, BACKGROUND)));
|
||||
buttons.add(addButton(new GuiButtonImage(BUTTON_PREV, x0+156,y0+30, 12,12, 180,30, 12, BACKGROUND)));
|
||||
// buttons.add(addButton(new GuiButtonImage(BUTTON_FROM_STORAGE, x0+49,y0+34, 9,17, 219,34, 17, BACKGROUND)));
|
||||
// buttons.add(addButton(new GuiButtonImage(BUTTON_TO_STORAGE, x0+49,y0+52, 9,17, 208,16, 17, BACKGROUND)));
|
||||
// buttons.add(addButton(new GuiButtonImage(BUTTON_FROM_PLAYER, x0+77,y0+71, 17,9, 198,71, 9, BACKGROUND)));
|
||||
// buttons.add(addButton(new GuiButtonImage(BUTTON_TO_PLAYER, x0+59,y0+71, 17,9, 180,71, 9, BACKGROUND)));
|
||||
buttons.add(addButton(new GuiButtonImage(BUTTON_NEXT, x0+158,y0+44, 12,12, 194,44, 12, BACKGROUND)));
|
||||
buttons.add(addButton(new GuiButtonImage(BUTTON_PREV, x0+158,y0+30, 12,12, 180,30, 12, BACKGROUND)));
|
||||
buttons.add(addButton(new GuiButtonImage(BUTTON_CLEAR_GRID, x0+158,y0+58, 12,12, 194,8, 12, BACKGROUND)));
|
||||
if(with_assist_quickmove_buttons) {
|
||||
buttons.add(addButton(new GuiButtonImage(BUTTON_FROM_STORAGE, x0+49, y0+34, 9,17, 219,34, 17, BACKGROUND)));
|
||||
buttons.add(addButton(new GuiButtonImage(BUTTON_TO_STORAGE, x0+49, y0+52, 9,17, 208,16, 17, BACKGROUND)));
|
||||
buttons.add(addButton(new GuiButtonImage(BUTTON_FROM_PLAYER, x0+77, y0+71, 17,9, 198,71, 9, BACKGROUND)));
|
||||
buttons.add(addButton(new GuiButtonImage(BUTTON_TO_PLAYER, x0+59, y0+71, 17,9, 180,71, 9, BACKGROUND)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -332,6 +386,26 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
renderHoveredToolTip(mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderHoveredToolTip(int mouseX, int mouseY)
|
||||
{
|
||||
if((!player.inventory.getItemStack().isEmpty()) || (getSlotUnderMouse() == null)) return;
|
||||
final Slot slot = getSlotUnderMouse();
|
||||
if(!slot.getStack().isEmpty()) { renderToolTip(slot.getStack(), mouseX, mouseY); return; }
|
||||
if(with_assist) {
|
||||
int hist_index = -1;
|
||||
if(slot instanceof BSlotCrafting) {
|
||||
hist_index = 0;
|
||||
} else if(slot.inventory instanceof BInventoryCrafting) {
|
||||
hist_index = slot.getSlotIndex() + 1;
|
||||
}
|
||||
if((hist_index < 0) || (hist_index >= history_slot_tooltip.length)) return;
|
||||
if(!history_slot_tooltip[hist_index]) return;
|
||||
ItemStack hist_stack = te.history.current().get(hist_index);
|
||||
if(!hist_stack.isEmpty()) renderToolTip(hist_stack, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
|
||||
{
|
||||
|
@ -340,14 +414,15 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
final int x0=((width - xSize)/2), y0=((height - ySize)/2);
|
||||
drawTexturedModalRect(x0, y0, 0, 0, xSize, ySize);
|
||||
if(with_assist) {
|
||||
for(int i=0; i<history_slot_tooltip.length; ++i) history_slot_tooltip[i] = false;
|
||||
List<ItemStack> crafting_template = te.history.current();
|
||||
if((crafting_template == null) || (crafting_template.isEmpty())) return;
|
||||
if(inventorySlots.getSlot(0).getHasStack()) return;
|
||||
{
|
||||
int i = 0;
|
||||
for(Tuple<Integer, Integer> e : ((BContainer) inventorySlots).CRAFTING_SLOT_POSITIONS) {
|
||||
if(i==0) continue; // explicitly here, that is the result slot.
|
||||
if((inventorySlots.getSlot(i).getHasStack())) {
|
||||
if(!inventorySlots.getSlot(i).getStack().getItem().equals(crafting_template.get(i).getItem())) {
|
||||
if(!inventorySlots.getSlot(i).getStack().isItemEqual(crafting_template.get(i))) {
|
||||
return; // user has placed another recipe
|
||||
}
|
||||
}
|
||||
|
@ -358,7 +433,14 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
int i = 0;
|
||||
for(Tuple<Integer, Integer> e : ((BContainer) inventorySlots).CRAFTING_SLOT_POSITIONS) {
|
||||
final ItemStack stack = crafting_template.get(i);
|
||||
if(!stack.isEmpty()) drawTemplateItemAt(stack, x0, y0, e.getFirst(), e.getSecond());
|
||||
if(!stack.isEmpty()) {
|
||||
if(!inventorySlots.getSlot(i).getHasStack()) history_slot_tooltip[i] = true;
|
||||
if((i==0) && inventorySlots.getSlot(i).getStack().isItemEqual(crafting_template.get(i))) {
|
||||
continue; // don't shade the output slot if the result can be crafted.
|
||||
} else {
|
||||
drawTemplateItemAt(stack, x0, y0, e.getFirst(), e.getSecond());
|
||||
}
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
@ -367,9 +449,10 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
|
||||
protected void drawTemplateItemAt(ItemStack stack, int x0, int y0, int x, int y)
|
||||
{
|
||||
final float main_zl = zLevel;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
float zl = itemRender.zLevel;
|
||||
final float zl = itemRender.zLevel;
|
||||
itemRender.zLevel = -50;
|
||||
itemRender.renderItemIntoGUI(stack, x0+x, y0+y);
|
||||
itemRender.zLevel = zl;
|
||||
|
@ -377,7 +460,9 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
GlStateManager.color(0.7f, 0.7f, 0.7f, 0.8f);
|
||||
mc.getTextureManager().bindTexture(BACKGROUND);
|
||||
drawTexturedModalRect(x0+x, y0+y, x, y, 16, 16);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
zLevel = main_zl;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -386,17 +471,58 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
switch(button.id) {
|
||||
case BUTTON_NEXT:
|
||||
case BUTTON_PREV:
|
||||
case BUTTON_CLEAR_GRID:
|
||||
case BUTTON_FROM_STORAGE:
|
||||
case BUTTON_TO_STORAGE:
|
||||
case BUTTON_FROM_PLAYER:
|
||||
case BUTTON_TO_PLAYER: {
|
||||
case BUTTON_TO_PLAYER:
|
||||
case ACTION_PLACE_CURRENT_HISTORY_SEL: {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("button", button.id);
|
||||
nbt.setInteger("action", button.id);
|
||||
Networking.PacketTileNotify.sendToServer(te, nbt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleMouseClick(Slot slot, int slotId, int mouseButton, ClickType type)
|
||||
{
|
||||
if(type == ClickType.PICKUP) {
|
||||
boolean place_refab = (slot instanceof BSlotCrafting) && (!slot.getHasStack());
|
||||
if(place_refab && with_assist_direct_history_refab) onHistoryItemPlacement(); // place before crafting -> direct item pick
|
||||
super.handleMouseClick(slot, slotId, mouseButton, type);
|
||||
if(place_refab && (!with_assist_direct_history_refab)) onHistoryItemPlacement(); // place after crafting -> confirmation first
|
||||
return;
|
||||
}
|
||||
if((type == ClickType.QUICK_MOVE) && (slotId > 9) && (slot.getHasStack())) { // container slots 0..9 are crafting output and grid
|
||||
List<ItemStack> history = te.history.current();
|
||||
boolean palce_in_crafting_grid = (!history.isEmpty());
|
||||
if(!palce_in_crafting_grid) {
|
||||
for(int i=0; i<9; ++i) {
|
||||
if(!(te.getStackInSlot(i).isEmpty())) { palce_in_crafting_grid = true; break; }
|
||||
}
|
||||
}
|
||||
if(palce_in_crafting_grid) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("action", ACTION_PLACE_SHIFTCLICKED_STACK);
|
||||
nbt.setInteger("containerslot", slotId);
|
||||
Networking.PacketTileNotify.sendToServer(te, nbt);
|
||||
return;
|
||||
}
|
||||
}
|
||||
super.handleMouseClick(slot, slotId, mouseButton, type);
|
||||
}
|
||||
|
||||
private void onHistoryItemPlacement()
|
||||
{
|
||||
if(te.history.current().isEmpty()) return;
|
||||
final Slot resultSlot = this.getSlotUnderMouse(); // double check
|
||||
if(!(resultSlot instanceof BSlotCrafting)) return;
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("action", ACTION_PLACE_CURRENT_HISTORY_SEL);
|
||||
Networking.PacketTileNotify.sendToServer(te, nbt);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -415,11 +541,12 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
protected void onCrafting(ItemStack stack)
|
||||
{
|
||||
if((with_assist) && ((player.world!=null) && (!(player.world.isRemote))) && (!stack.isEmpty())) {
|
||||
final IRecipe recipe = ((InventoryCraftResult)this.inventory).getRecipeUsed();
|
||||
final ArrayList<ItemStack> grid = new ArrayList<ItemStack>();
|
||||
grid.add(stack);
|
||||
for(int i = 0; i < 9; ++i) grid.add(te.stacks.get(i));
|
||||
te.history.add(grid);
|
||||
te.history.reset_curent();
|
||||
te.history.add(grid, recipe);
|
||||
te.history.reset_current();
|
||||
te.syncHistory(player);
|
||||
}
|
||||
super.onCrafting(stack);
|
||||
|
@ -430,7 +557,7 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
// Crafting container
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
private static class BContainer extends Container
|
||||
public static class BContainer extends Container
|
||||
{
|
||||
private final World world;
|
||||
private final BlockPos pos;
|
||||
|
@ -449,28 +576,33 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
this.te = te;
|
||||
craftMatrix = new BInventoryCrafting(this, te);
|
||||
craftMatrix.openInventory(player);
|
||||
// container slotId 0 === crafting output
|
||||
addSlotToContainer(new BSlotCrafting(te, playerInventory.player, craftMatrix, craftResult, 0, 134, 35));
|
||||
slotpositions.add(new Tuple<>(134, 35));
|
||||
// container slotId 1..9 === TE slots 0..8
|
||||
for(int y=0; y<3; ++y) {
|
||||
for(int x=0; x<3; ++x) {
|
||||
int xpos = 60+x*18;
|
||||
int ypos = 17+y*18;
|
||||
addSlotToContainer(new Slot(craftMatrix, x+y*3, xpos, ypos)); // block slots 0..8
|
||||
addSlotToContainer(new Slot(craftMatrix, x+y*3, xpos, ypos));
|
||||
slotpositions.add(new Tuple<>(xpos, ypos));
|
||||
}
|
||||
}
|
||||
CRAFTING_SLOT_POSITIONS = ImmutableList.copyOf(slotpositions);
|
||||
// container slotId 10..36 === player slots: 9..35
|
||||
for(int y=0; y<3; ++y) {
|
||||
for (int x=0; x<9; ++x) {
|
||||
addSlotToContainer(new Slot(playerInventory, x+y*9+9, 8+x*18, 86+y*18)); // player slots: 9..35
|
||||
for(int x=0; x<9; ++x) {
|
||||
addSlotToContainer(new Slot(playerInventory, x+y*9+9, 8+x*18, 86+y*18));
|
||||
}
|
||||
}
|
||||
// container slotId 37..45 === player slots: 0..8
|
||||
for(int x=0; x<9; ++x) {
|
||||
addSlotToContainer(new Slot(playerInventory, x, 8+x*18, 144)); // player slots: 0..8
|
||||
addSlotToContainer(new Slot(playerInventory, x, 8+x*18, 144));
|
||||
}
|
||||
// container slotId 46..53 === TE slots 9..17 (storage)
|
||||
for(int y=0; y<4; ++y) {
|
||||
for (int x=0; x<2; ++x) {
|
||||
addSlotToContainer(new Slot(craftMatrix, x+y*2+9, 8+x*18, 9+y*18)); // block slots 9..17
|
||||
for(int x=0; x<2; ++x) {
|
||||
addSlotToContainer(new Slot(craftMatrix, x+y*2+9, 8+x*18, 9+y*18));
|
||||
}
|
||||
}
|
||||
onCraftMatrixChanged(craftMatrix);
|
||||
|
@ -541,6 +673,9 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
public void setCraftingMatrixSlot(int slot_index, ItemStack stack)
|
||||
{ craftMatrix.setInventorySlotContents(slot_index, stack.copy()); }
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -599,7 +734,9 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
//--------------------------------------------------------------------------------------------------------------------
|
||||
public static class BTileEntity extends TileEntity implements IInventory, Networking.IPacketReceiver
|
||||
{
|
||||
public static final int CRAFTING_SLOTS_BEGIN = 0;
|
||||
public static final int NUM_OF_CRAFTING_SLOTS = 9;
|
||||
public static final int STORAGE_SLOTS_BEGIN = NUM_OF_CRAFTING_SLOTS;
|
||||
public static final int NUM_OF_STORAGE_SLOTS = 8;
|
||||
public static final int NUM_OF_SLOTS = NUM_OF_CRAFTING_SLOTS+NUM_OF_STORAGE_SLOTS;
|
||||
protected NonNullList<ItemStack> stacks;
|
||||
|
@ -625,35 +762,384 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
history.write(compound);
|
||||
}
|
||||
|
||||
// private aux methods ---------------------------------------------------------------------
|
||||
|
||||
private boolean itemstack_recipe_match(ItemStack grid_stack, ItemStack history_stack)
|
||||
{
|
||||
if(history.current_recipe()!=null) {
|
||||
boolean grid_match, dist_match;
|
||||
for(final Ingredient ingredient:history.current_recipe().getIngredients()) {
|
||||
grid_match = false; dist_match = false;
|
||||
for(final ItemStack match:ingredient.getMatchingStacks()) {
|
||||
if(match.isItemEqualIgnoreDurability(grid_stack)) dist_match = true;
|
||||
if(match.isItemEqualIgnoreDurability(history_stack)) grid_match = true;
|
||||
if(dist_match && grid_match) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<ItemStack> crafting_slot_stacks_to_add()
|
||||
{
|
||||
final ArrayList<ItemStack> slots = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> tocraft = history.current();
|
||||
final int stack_sizes[] = {-1,-1,-1,-1,-1,-1,-1,-1,-1};
|
||||
if(tocraft.isEmpty()) return slots;
|
||||
for(int i=0; i<9; ++i) {
|
||||
if((i+CraftingHistory.INPUT_STACKS_BEGIN) >= tocraft.size()) break;
|
||||
final ItemStack needed = tocraft.get(i+CraftingHistory.INPUT_STACKS_BEGIN);
|
||||
final ItemStack palced = getStackInSlot(i+CRAFTING_SLOTS_BEGIN);
|
||||
if(needed.isEmpty() && (!palced.isEmpty())) return slots; // history vs grid mismatch.
|
||||
if((!palced.isEmpty()) && (!itemstack_recipe_match(needed, palced))) return slots; // also mismatch
|
||||
if(!needed.isEmpty()) stack_sizes[i] = palced.getCount();
|
||||
}
|
||||
int min_placed = 64, max_placed=0;
|
||||
for(int i=0; i<9; ++i) { // todo: check if java has something like std::accumulate<>()
|
||||
if(stack_sizes[i] < 0) continue;
|
||||
min_placed = Math.min(min_placed, stack_sizes[i]);
|
||||
max_placed = Math.max(max_placed, stack_sizes[i]);
|
||||
}
|
||||
int fillup_size = (max_placed <= min_placed) ? (min_placed + 1) : max_placed;
|
||||
for(int i=0; i<9; ++i) {
|
||||
if(stack_sizes[i] < 0) continue;
|
||||
if(fillup_size > getStackInSlot(i+CRAFTING_SLOTS_BEGIN).getMaxStackSize()) return slots; // can't fillup all
|
||||
}
|
||||
for(int i=0; i<9; ++i) {
|
||||
if(stack_sizes[i] < 0) {
|
||||
slots.add(ItemStack.EMPTY);
|
||||
} else {
|
||||
ItemStack st = getStackInSlot(i+CRAFTING_SLOTS_BEGIN).copy();
|
||||
if(st.isEmpty()) {
|
||||
st = tocraft.get(i+CraftingHistory.INPUT_STACKS_BEGIN).copy();
|
||||
st.setCount(Math.min(st.getMaxStackSize(), fillup_size));
|
||||
} else {
|
||||
st.setCount(MathHelper.clamp(fillup_size-st.getCount(), 0, st.getMaxStackSize()));
|
||||
}
|
||||
slots.add(st);
|
||||
}
|
||||
}
|
||||
return slots;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves as much items from the stack to the slots in range [first_slot, last_slot] of the inventory,
|
||||
* filling up existing stacks first, then (player inventory only) checks appropriate empty slots next
|
||||
* to stacks that have that item already, and last uses any empty slot that can be found.
|
||||
* Returns the stack that is still remaining in the referenced `stack`.
|
||||
*/
|
||||
private ItemStack move_stack_to_inventory(final ItemStack stack_to_move, IInventory inventory, final int slot_begin, final int slot_end, boolean only_fillup)
|
||||
{
|
||||
final ItemStack mvstack = stack_to_move.copy();
|
||||
if((mvstack.isEmpty()) || (slot_begin < 0) || (slot_end > inventory.getSizeInventory())) return mvstack;
|
||||
// first iteration: fillup existing stacks
|
||||
for(int i = slot_begin; i < slot_end; ++i) {
|
||||
final ItemStack stack = inventory.getStackInSlot(i);
|
||||
if((stack.isEmpty()) || (!stack.isItemEqual(mvstack))) continue;
|
||||
int nmax = stack.getMaxStackSize() - stack.getCount();
|
||||
if(mvstack.getCount() <= nmax) {
|
||||
stack.setCount(stack.getCount()+mvstack.getCount());
|
||||
mvstack.setCount(0);
|
||||
inventory.setInventorySlotContents(i, stack);
|
||||
return mvstack;
|
||||
} else {
|
||||
stack.setCount(stack.getMaxStackSize());
|
||||
mvstack.shrink(nmax);
|
||||
inventory.setInventorySlotContents(i, stack);
|
||||
}
|
||||
}
|
||||
if(only_fillup) return mvstack;
|
||||
if(inventory instanceof InventoryPlayer) {
|
||||
// second iteration: use appropriate empty slots
|
||||
for(int i = slot_begin+1; i < slot_end-1; ++i) {
|
||||
final ItemStack stack = inventory.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) continue;
|
||||
if((!inventory.getStackInSlot(i+1).isItemEqual(mvstack)) && (!inventory.getStackInSlot(i-1).isItemEqual(mvstack))) continue;
|
||||
inventory.setInventorySlotContents(i, mvstack.copy());
|
||||
mvstack.setCount(0);
|
||||
return mvstack;
|
||||
}
|
||||
}
|
||||
// third iteration: use any empty slots
|
||||
for(int i = slot_begin; i < slot_end; ++i) {
|
||||
final ItemStack stack = inventory.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) continue;
|
||||
inventory.setInventorySlotContents(i, mvstack.copy());
|
||||
mvstack.setCount(0);
|
||||
return mvstack;
|
||||
}
|
||||
return mvstack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves as much items from the slots in range [first_slot, last_slot] of the inventory into a new stack.
|
||||
* Implicitly shrinks the inventory stacks and the `request_stack`.
|
||||
*/
|
||||
private ItemStack move_stack_from_inventory(IInventory inventory, final ItemStack request_stack, final int slot_begin, final int slot_end)
|
||||
{
|
||||
ItemStack fetched_stack = request_stack.copy();
|
||||
fetched_stack.setCount(0);
|
||||
int n_left = request_stack.getCount();
|
||||
while(n_left > 0) {
|
||||
int smallest_stack_size = 0;
|
||||
int smallest_stack_index = -1;
|
||||
for(int i = slot_begin; i < slot_end; ++i) {
|
||||
final ItemStack stack = inventory.getStackInSlot(i);
|
||||
if((!stack.isEmpty()) && (stack.isItemEqual(request_stack))) {
|
||||
// Never automatically place stuff with nbt (except a few allowed like "Damage"),
|
||||
// as this could be a full crate, a valuable tool item, etc. For these recipes
|
||||
// the user has to place this item manually.
|
||||
if(stack.hasTagCompound()) {
|
||||
final NBTTagCompound nbt = stack.getTagCompound();
|
||||
int n = stack.getTagCompound().getSize();
|
||||
if((n > 0) && (stack.getTagCompound().hasKey("Damage"))) --n;
|
||||
if(n > 0) continue;
|
||||
}
|
||||
fetched_stack = stack.copy(); // copy exact stack with nbt and tool damage, otherwise we have an automagical repair of items.
|
||||
fetched_stack.setCount(0);
|
||||
int n = stack.getCount();
|
||||
if((n < smallest_stack_size) || (smallest_stack_size <= 0)) {
|
||||
smallest_stack_size = n;
|
||||
smallest_stack_index = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(smallest_stack_index < 0) {
|
||||
break; // no more items available
|
||||
} else {
|
||||
int n = Math.min(n_left, smallest_stack_size);
|
||||
n_left -= n;
|
||||
fetched_stack.grow(n);
|
||||
ItemStack st = inventory.getStackInSlot(smallest_stack_index);
|
||||
st.shrink(n);
|
||||
inventory.setInventorySlotContents(smallest_stack_index, st);
|
||||
}
|
||||
}
|
||||
return fetched_stack;
|
||||
}
|
||||
|
||||
private boolean clear_grid_to_storage(EntityPlayer player)
|
||||
{
|
||||
boolean changed = false;
|
||||
for(int grid_i = CRAFTING_SLOTS_BEGIN; grid_i < (CRAFTING_SLOTS_BEGIN + NUM_OF_CRAFTING_SLOTS); ++grid_i) {
|
||||
ItemStack stack = getStackInSlot(grid_i);
|
||||
if(stack.isEmpty()) continue;
|
||||
ItemStack remaining = move_stack_to_inventory(stack, this, STORAGE_SLOTS_BEGIN, STORAGE_SLOTS_BEGIN+NUM_OF_STORAGE_SLOTS, false);
|
||||
setInventorySlotContents(grid_i, remaining);
|
||||
changed = true;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
private boolean clear_grid_to_player(EntityPlayer player)
|
||||
{
|
||||
boolean changed = false;
|
||||
for(int grid_i = CRAFTING_SLOTS_BEGIN; grid_i < (CRAFTING_SLOTS_BEGIN + NUM_OF_CRAFTING_SLOTS); ++grid_i) {
|
||||
ItemStack remaining = getStackInSlot(grid_i);
|
||||
if(remaining.isEmpty()) continue;
|
||||
remaining = move_stack_to_inventory(remaining, player.inventory,9, 36, true); // prefer filling up inventory stacks
|
||||
remaining = move_stack_to_inventory(remaining, player.inventory,0, 9, true); // then fill up the hotbar stacks
|
||||
remaining = move_stack_to_inventory(remaining, player.inventory,9, 36, false); // then allow empty stacks in inventory
|
||||
remaining = move_stack_to_inventory(remaining, player.inventory,0, 9, false); // then new stacks in the hotbar
|
||||
this.setInventorySlotContents(grid_i, remaining);
|
||||
changed = true;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
enum EnumRefabPlacement { UNCHANGED, INCOMPLETE, PLACED }
|
||||
private EnumRefabPlacement place_refab_stacks(IInventory inventory, final int slot_begin, final int slot_end)
|
||||
{
|
||||
List<ItemStack> to_fill = crafting_slot_stacks_to_add();
|
||||
boolean slots_changed = false;
|
||||
boolean missing_item = false;
|
||||
int num_slots_placed = 0;
|
||||
if(!to_fill.isEmpty()) {
|
||||
for(int it_guard=63; it_guard>=0; --it_guard) {
|
||||
boolean slots_updated = false;
|
||||
for(int i = 0; i < 9; ++i) {
|
||||
final ItemStack req_stack = to_fill.get(i).copy();
|
||||
if(req_stack.isEmpty()) continue;
|
||||
req_stack.setCount(1);
|
||||
to_fill.get(i).shrink(1);
|
||||
final ItemStack mv_stack = move_stack_from_inventory(inventory, req_stack, slot_begin, slot_end);
|
||||
if(mv_stack.isEmpty()) { missing_item=true; continue; }
|
||||
// sizes already checked
|
||||
ItemStack grid_stack = getStackInSlot(i + CRAFTING_SLOTS_BEGIN).copy();
|
||||
if(grid_stack.isEmpty()) {
|
||||
grid_stack = mv_stack.copy();
|
||||
} else {
|
||||
grid_stack.grow(mv_stack.getCount());
|
||||
}
|
||||
setInventorySlotContents(i + CRAFTING_SLOTS_BEGIN, grid_stack);
|
||||
slots_changed = true;
|
||||
slots_updated = true;
|
||||
}
|
||||
if(!slots_updated) break;
|
||||
}
|
||||
}
|
||||
if(!slots_changed) {
|
||||
return EnumRefabPlacement.UNCHANGED;
|
||||
} else if(missing_item) {
|
||||
return EnumRefabPlacement.INCOMPLETE;
|
||||
} else {
|
||||
return EnumRefabPlacement.PLACED;
|
||||
}
|
||||
}
|
||||
|
||||
private EnumRefabPlacement distribute_stack(IInventory inventory, final int slotno)
|
||||
{
|
||||
List<ItemStack> to_refab = crafting_slot_stacks_to_add();
|
||||
ItemStack to_distribute = inventory.getStackInSlot(slotno).copy();
|
||||
if(to_distribute.isEmpty()) return EnumRefabPlacement.UNCHANGED;
|
||||
int matching_grid_stack_sizes[] = {-1,-1,-1,-1,-1,-1,-1,-1,-1};
|
||||
int max_matching_stack_size = -1;
|
||||
int min_matching_stack_size = 65;
|
||||
int total_num_missing_stacks = 0;
|
||||
for(int i=0; i<9; ++i) {
|
||||
final ItemStack grid_stack = getStackInSlot(i + CRAFTING_SLOTS_BEGIN);
|
||||
final ItemStack refab_stack = to_refab.isEmpty() ? ItemStack.EMPTY : to_refab.get(i).copy();
|
||||
if((!grid_stack.isEmpty()) && (grid_stack.isItemEqual(to_distribute))) {
|
||||
matching_grid_stack_sizes[i] = grid_stack.getCount();
|
||||
total_num_missing_stacks += grid_stack.getMaxStackSize()-grid_stack.getCount();
|
||||
if(max_matching_stack_size < matching_grid_stack_sizes[i]) max_matching_stack_size = matching_grid_stack_sizes[i];
|
||||
if(min_matching_stack_size > matching_grid_stack_sizes[i]) min_matching_stack_size = matching_grid_stack_sizes[i];
|
||||
} else if((!refab_stack.isEmpty()) && (refab_stack.isItemEqual(to_distribute))) {
|
||||
matching_grid_stack_sizes[i] = 0;
|
||||
total_num_missing_stacks += grid_stack.getMaxStackSize();
|
||||
if(max_matching_stack_size < matching_grid_stack_sizes[i]) max_matching_stack_size = matching_grid_stack_sizes[i];
|
||||
if(min_matching_stack_size > matching_grid_stack_sizes[i]) min_matching_stack_size = matching_grid_stack_sizes[i];
|
||||
} else if(grid_stack.isEmpty() && (!refab_stack.isEmpty())) {
|
||||
if(itemstack_recipe_match(to_distribute, refab_stack)) {
|
||||
matching_grid_stack_sizes[i] = 0;
|
||||
total_num_missing_stacks += grid_stack.getMaxStackSize();
|
||||
if(max_matching_stack_size < matching_grid_stack_sizes[i]) max_matching_stack_size = matching_grid_stack_sizes[i];
|
||||
if(min_matching_stack_size > matching_grid_stack_sizes[i]) min_matching_stack_size = matching_grid_stack_sizes[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(min_matching_stack_size < 0) return EnumRefabPlacement.UNCHANGED;
|
||||
final int stack_limit_size = Math.min(to_distribute.getMaxStackSize(), getInventoryStackLimit());
|
||||
if(min_matching_stack_size >= stack_limit_size) return EnumRefabPlacement.UNCHANGED;
|
||||
int n_to_distribute = to_distribute.getCount();
|
||||
for(int it_guard=63; it_guard>=0; --it_guard) {
|
||||
if(n_to_distribute <= 0) break;
|
||||
for(int i=0; i<9; ++i) {
|
||||
if(n_to_distribute <= 0) break;
|
||||
if(matching_grid_stack_sizes[i] == min_matching_stack_size) {
|
||||
++matching_grid_stack_sizes[i];
|
||||
--n_to_distribute;
|
||||
}
|
||||
}
|
||||
if(min_matching_stack_size < max_matching_stack_size) {
|
||||
++min_matching_stack_size; // distribute short stacks
|
||||
} else {
|
||||
++min_matching_stack_size; // stacks even, increase all
|
||||
max_matching_stack_size = min_matching_stack_size;
|
||||
}
|
||||
if(min_matching_stack_size >= stack_limit_size) break; // all full
|
||||
}
|
||||
if(n_to_distribute == to_distribute.getCount()) return EnumRefabPlacement.UNCHANGED; // was already full
|
||||
if(n_to_distribute <= 0) {
|
||||
inventory.setInventorySlotContents(slotno, ItemStack.EMPTY);
|
||||
} else {
|
||||
to_distribute.setCount(n_to_distribute);
|
||||
inventory.setInventorySlotContents(slotno, to_distribute);
|
||||
}
|
||||
for(int i=0; i<9; ++i) {
|
||||
if(matching_grid_stack_sizes[i] < 0) continue;
|
||||
ItemStack grid_stack = getStackInSlot(i + CRAFTING_SLOTS_BEGIN).copy();
|
||||
if(grid_stack.isEmpty()) grid_stack = to_distribute.copy();
|
||||
grid_stack.setCount(matching_grid_stack_sizes[i]);
|
||||
setInventorySlotContents(i + CRAFTING_SLOTS_BEGIN, grid_stack);
|
||||
}
|
||||
return EnumRefabPlacement.PLACED;
|
||||
}
|
||||
|
||||
// Networking.IPacketReceiver --------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public void onClientPacketReceived(EntityPlayer player, NBTTagCompound nbt)
|
||||
{
|
||||
if(with_assist && nbt.hasKey("button")) {
|
||||
switch(nbt.getInteger("button")) {
|
||||
case BGui.BUTTON_NEXT:
|
||||
if((world.isRemote) || (!(player.openContainer instanceof BContainer))) return;
|
||||
final BContainer container = (BContainer)player.openContainer;
|
||||
if(container.te != this) return;
|
||||
boolean te_changed = false;
|
||||
boolean player_inventory_changed = false;
|
||||
if(with_assist && nbt.hasKey("action")) {
|
||||
switch(nbt.getInteger("action")) {
|
||||
case BGui.BUTTON_NEXT: {
|
||||
history.next();
|
||||
syncHistory(player);
|
||||
break;
|
||||
case BGui.BUTTON_PREV:
|
||||
// implicitly clear the grid, so that the player can see the refab, and that no recipe is active.
|
||||
if(clear_grid_to_player(player)) { te_changed = true; player_inventory_changed = true; }
|
||||
if(clear_grid_to_storage(player)) te_changed = true;
|
||||
} break;
|
||||
case BGui.BUTTON_PREV: {
|
||||
history.prev();
|
||||
syncHistory(player);
|
||||
break;
|
||||
case BGui.BUTTON_FROM_STORAGE:
|
||||
//System.out.println("BUTTON_FROM_STORAGE");
|
||||
break;
|
||||
case BGui.BUTTON_TO_STORAGE:
|
||||
//System.out.println("BUTTON_TO_STORAGE");
|
||||
break;
|
||||
case BGui.BUTTON_FROM_PLAYER:
|
||||
//System.out.println("BUTTON_FROM_PLAYER");
|
||||
break;
|
||||
case BGui.BUTTON_TO_PLAYER:
|
||||
//System.out.println("BUTTON_TO_PLAYER");
|
||||
break;
|
||||
if(clear_grid_to_player(player)) { te_changed = true; player_inventory_changed = true; }
|
||||
if(clear_grid_to_storage(player)) te_changed = true;
|
||||
} break;
|
||||
case BGui.BUTTON_CLEAR_GRID: {
|
||||
history.reset_selection();
|
||||
syncHistory(player);
|
||||
if(clear_grid_to_player(player)) { te_changed = true; player_inventory_changed = true; }
|
||||
if(clear_grid_to_storage(player)) te_changed = true;
|
||||
} break;
|
||||
case BGui.BUTTON_TO_STORAGE: {
|
||||
if(clear_grid_to_storage(player)) te_changed = true;
|
||||
} break;
|
||||
case BGui.BUTTON_TO_PLAYER: {
|
||||
if(clear_grid_to_player(player)) { te_changed = true; player_inventory_changed = true; }
|
||||
} break;
|
||||
case BGui.BUTTON_FROM_STORAGE: {
|
||||
EnumRefabPlacement from_storage = place_refab_stacks(this, STORAGE_SLOTS_BEGIN, STORAGE_SLOTS_BEGIN + NUM_OF_STORAGE_SLOTS);
|
||||
if(from_storage != EnumRefabPlacement.UNCHANGED) te_changed = true;
|
||||
} break;
|
||||
case BGui.BUTTON_FROM_PLAYER: {
|
||||
EnumRefabPlacement from_player_inv = place_refab_stacks(player.inventory, 9, 36);
|
||||
if(from_player_inv != EnumRefabPlacement.UNCHANGED) { te_changed = true; player_inventory_changed = true; }
|
||||
if(from_player_inv != EnumRefabPlacement.PLACED) {
|
||||
EnumRefabPlacement from_hotbar = place_refab_stacks(player.inventory, 0, 9);
|
||||
if(from_hotbar != EnumRefabPlacement.UNCHANGED) { te_changed = true; player_inventory_changed = true; }
|
||||
}
|
||||
} break;
|
||||
case BGui.ACTION_PLACE_CURRENT_HISTORY_SEL: {
|
||||
EnumRefabPlacement from_storage = place_refab_stacks(this, STORAGE_SLOTS_BEGIN, STORAGE_SLOTS_BEGIN + NUM_OF_STORAGE_SLOTS);
|
||||
if(from_storage != EnumRefabPlacement.UNCHANGED) te_changed = true;
|
||||
if(from_storage != EnumRefabPlacement.PLACED) {
|
||||
EnumRefabPlacement from_player_inv = place_refab_stacks(player.inventory, 9, 36);
|
||||
if(from_player_inv != EnumRefabPlacement.UNCHANGED) { te_changed = true; player_inventory_changed = true; }
|
||||
if(from_player_inv != EnumRefabPlacement.PLACED) {
|
||||
EnumRefabPlacement from_hotbar = place_refab_stacks(player.inventory, 0, 9);
|
||||
if(from_hotbar != EnumRefabPlacement.UNCHANGED) { te_changed = true; player_inventory_changed = true; }
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case BGui.ACTION_PLACE_SHIFTCLICKED_STACK: {
|
||||
final int container_slot_id = nbt.getInteger("containerslot");
|
||||
if((container_slot_id < 10) || (container_slot_id > 53)) break; // out of range
|
||||
if(container_slot_id >= 46) {
|
||||
// from storage
|
||||
final int storage_slot = container_slot_id - 46 + STORAGE_SLOTS_BEGIN;
|
||||
EnumRefabPlacement stat = distribute_stack(this, storage_slot);
|
||||
if(stat != EnumRefabPlacement.UNCHANGED) te_changed = true;
|
||||
} else {
|
||||
// from player
|
||||
int player_slot = (container_slot_id >= 37) ? (container_slot_id-37) : (container_slot_id-10+9);
|
||||
EnumRefabPlacement stat = distribute_stack(player.inventory, player_slot);
|
||||
if(stat != EnumRefabPlacement.UNCHANGED) { player_inventory_changed = true; te_changed = true; }
|
||||
}
|
||||
} break;
|
||||
}
|
||||
}
|
||||
if(te_changed) markDirty();
|
||||
if(player_inventory_changed) player.inventory.markDirty();
|
||||
if(te_changed || player_inventory_changed) {
|
||||
container.onCraftMatrixChanged(this);
|
||||
container.detectAndSendChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import wile.engineersdecor.detail.ModAuxiliaries;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.BlockDirectional;
|
||||
|
@ -16,9 +15,11 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Mirror;
|
||||
import net.minecraft.util.Rotation;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
@ -67,12 +68,14 @@ public class BlockDecorDirected extends BlockDecor
|
|||
{ return false; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{ return (int)((config & CFG_LIGHT_VALUE_MASK) >> CFG_LIGHT_VALUE_SHIFT); }
|
||||
|
||||
@Override
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing face)
|
||||
{ return BlockFaceShape.UNDEFINED; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{ return AABBs.get(((EnumFacing)state.getValue(FACING)).getIndex() & 0x7); }
|
||||
|
||||
|
@ -102,7 +105,6 @@ public class BlockDecorDirected extends BlockDecor
|
|||
{ return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING))); }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
if(!super.canPlaceBlockOnSide(world, pos, side)) return false;
|
||||
|
@ -110,8 +112,7 @@ public class BlockDecorDirected extends BlockDecor
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand)
|
||||
{
|
||||
if((config & (CFG_HORIZIONTAL|CFG_LOOK_PLACEMENT)) == (CFG_HORIZIONTAL|CFG_LOOK_PLACEMENT)) {
|
||||
// horizontal placement in direction the player is looking
|
||||
|
@ -126,6 +127,7 @@ public class BlockDecorDirected extends BlockDecor
|
|||
// default: placement on the face the player clicking
|
||||
}
|
||||
if((config & CFG_OPPOSITE_PLACEMENT)!=0) facing = facing.getOpposite();
|
||||
if(((config & CFG_FLIP_PLACEMENT_SHIFTCLICK) != 0) && (placer.isSneaking())) facing = facing.getOpposite();
|
||||
return getDefaultState().withProperty(FACING, facing);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,10 +23,7 @@ import javax.annotation.Nullable;
|
|||
public class BlockDecorFull extends BlockDecor
|
||||
{
|
||||
public BlockDecorFull(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound)
|
||||
{
|
||||
super(registryName, config, material, hardness, resistance, sound);
|
||||
setLightOpacity(255);
|
||||
}
|
||||
{ super(registryName, config, material, hardness, resistance, sound); }
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state)
|
||||
|
|
|
@ -8,12 +8,9 @@
|
|||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
import net.minecraftforge.energy.IEnergyStorage;
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.detail.ExtItems;
|
||||
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
|
@ -23,6 +20,7 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -30,6 +28,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
|||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
|
@ -43,12 +42,15 @@ import net.minecraft.util.text.TextComponentTranslation;
|
|||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
import net.minecraftforge.energy.IEnergyStorage;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.SidedInvWrapper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import wile.engineersdecor.detail.ExtItems;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Map;
|
||||
|
@ -469,7 +471,7 @@ public class BlockDecorFurnace extends BlockDecorDirected
|
|||
private int proc_time_needed_;
|
||||
private int boost_energy_; // small, not saved in nbt.
|
||||
private boolean heater_inserted_ = false;
|
||||
private NonNullList<ItemStack> stacks_;
|
||||
protected NonNullList<ItemStack> stacks_;
|
||||
|
||||
public static void on_config(int speed_percent, int fuel_efficiency_percent, int boost_energy_per_tick)
|
||||
{
|
||||
|
@ -483,7 +485,7 @@ public class BlockDecorFurnace extends BlockDecorDirected
|
|||
public BTileEntity()
|
||||
{ reset(); }
|
||||
|
||||
public void reset()
|
||||
protected void reset()
|
||||
{
|
||||
stacks_ = NonNullList.<ItemStack>withSize(NUM_OF_SLOTS, ItemStack.EMPTY);
|
||||
proc_time_elapsed_ = 0;
|
||||
|
@ -505,7 +507,7 @@ public class BlockDecorFurnace extends BlockDecorDirected
|
|||
fuel_burntime_ = getItemBurnTime(stacks_.get(SMELTING_FUEL_SLOT_NO));
|
||||
}
|
||||
|
||||
private void writenbt(NBTTagCompound compound)
|
||||
protected void writenbt(NBTTagCompound compound)
|
||||
{
|
||||
compound.setInteger("BurnTime", MathHelper.clamp(burntime_left_,0 , MAX_BURNTIME));
|
||||
compound.setInteger("CookTime", MathHelper.clamp(proc_time_elapsed_, 0, MAX_BURNTIME));
|
||||
|
@ -650,68 +652,6 @@ public class BlockDecorFurnace extends BlockDecorDirected
|
|||
public void clear()
|
||||
{ stacks_.clear(); }
|
||||
|
||||
@Override
|
||||
public void update()
|
||||
{
|
||||
if(--tick_timer_ > 0) return;
|
||||
tick_timer_ = TICK_INTERVAL;
|
||||
final boolean was_burning = isBurning();
|
||||
if(was_burning) burntime_left_ -= TICK_INTERVAL;
|
||||
if(burntime_left_ < 0) burntime_left_ = 0;
|
||||
if(world.isRemote) return;
|
||||
boolean dirty = false;
|
||||
if(--fifo_timer_ <= 0) {
|
||||
fifo_timer_ = FIFO_INTERVAL/TICK_INTERVAL;
|
||||
// note, intentionally not using bitwise OR piping.
|
||||
if(transferItems(FIFO_OUTPUT_0_SLOT_NO, FIFO_OUTPUT_1_SLOT_NO, 1)) dirty = true;
|
||||
if(transferItems(SMELTING_OUTPUT_SLOT_NO, FIFO_OUTPUT_0_SLOT_NO, 1)) dirty = true;
|
||||
if(transferItems(FIFO_FUEL_0_SLOT_NO, SMELTING_FUEL_SLOT_NO, 1)) dirty = true;
|
||||
if(transferItems(FIFO_FUEL_1_SLOT_NO, FIFO_FUEL_0_SLOT_NO, 1)) dirty = true;
|
||||
if(transferItems(FIFO_INPUT_0_SLOT_NO, SMELTING_INPUT_SLOT_NO, 1)) dirty = true;
|
||||
if(transferItems(FIFO_INPUT_1_SLOT_NO, FIFO_INPUT_0_SLOT_NO, 1)) dirty = true;
|
||||
heater_inserted_ = (ExtItems.IE_EXTERNAL_HEATER==null) // without IE always allow electrical boost
|
||||
|| (stacks_.get(AUX_0_SLOT_NO).getItem()==ExtItems.IE_EXTERNAL_HEATER)
|
||||
|| (stacks_.get(AUX_1_SLOT_NO).getItem()==ExtItems.IE_EXTERNAL_HEATER);
|
||||
}
|
||||
ItemStack fuel = stacks_.get(SMELTING_FUEL_SLOT_NO);
|
||||
if(isBurning() || (!fuel.isEmpty()) && (!(stacks_.get(SMELTING_INPUT_SLOT_NO)).isEmpty())) {
|
||||
if(!isBurning() && canSmelt()) {
|
||||
burntime_left_ = (int)MathHelper.clamp((proc_fuel_efficiency_ * getItemBurnTime(fuel)), 0, MAX_BURNTIME);
|
||||
fuel_burntime_ = (burntime_left_ * proc_speed_interval_) / VANILLA_FURNACE_SPEED_INTERVAL;
|
||||
if(isBurning()) {
|
||||
dirty = true;
|
||||
if(!fuel.isEmpty()) {
|
||||
Item fuel_item = fuel.getItem();
|
||||
fuel.shrink(1);
|
||||
if(fuel.isEmpty()) stacks_.set(SMELTING_FUEL_SLOT_NO, fuel_item.getContainerItem(fuel));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isBurning() && canSmelt()) {
|
||||
proc_time_elapsed_ += TICK_INTERVAL;
|
||||
if(heater_inserted_ && (boost_energy_ >= boost_energy_consumption)) { boost_energy_ = 0; proc_time_elapsed_ += TICK_INTERVAL; }
|
||||
if(proc_time_elapsed_ >= proc_time_needed_) {
|
||||
proc_time_elapsed_ = 0;
|
||||
proc_time_needed_ = getCookTime(stacks_.get(SMELTING_INPUT_SLOT_NO));
|
||||
smeltItem();
|
||||
dirty = true;
|
||||
}
|
||||
} else {
|
||||
proc_time_elapsed_ = 0;
|
||||
}
|
||||
} else if(!isBurning() && (proc_time_elapsed_ > 0)) {
|
||||
proc_time_elapsed_ = MathHelper.clamp(proc_time_elapsed_-2, 0, proc_time_needed_);
|
||||
}
|
||||
if(was_burning != isBurning()) {
|
||||
dirty = true;
|
||||
final IBlockState state = world.getBlockState(pos);
|
||||
if(state.getBlock() instanceof BlockDecorFurnace) {
|
||||
world.setBlockState(pos, state.withProperty(LIT, isBurning()));
|
||||
}
|
||||
}
|
||||
if(dirty) markDirty();
|
||||
}
|
||||
|
||||
public boolean isBurning()
|
||||
{ return burntime_left_ > 0; }
|
||||
|
||||
|
@ -752,7 +692,7 @@ public class BlockDecorFurnace extends BlockDecorDirected
|
|||
return changed;
|
||||
}
|
||||
|
||||
private boolean canSmelt()
|
||||
protected boolean canSmelt()
|
||||
{
|
||||
if(stacks_.get(SMELTING_INPUT_SLOT_NO).isEmpty()) return false;
|
||||
final ItemStack recipe_result_items = BRecipes.instance().getSmeltingResult(stacks_.get(SMELTING_INPUT_SLOT_NO));
|
||||
|
@ -770,7 +710,6 @@ public class BlockDecorFurnace extends BlockDecorDirected
|
|||
final ItemStack smelting_input_stack = stacks_.get(SMELTING_INPUT_SLOT_NO);
|
||||
final ItemStack recipe_result_items = BRecipes.instance().getSmeltingResult(smelting_input_stack);
|
||||
final ItemStack smelting_output_stack = stacks_.get(SMELTING_OUTPUT_SLOT_NO);
|
||||
final ItemStack fuel_stack = stacks_.get(SMELTING_FUEL_SLOT_NO);
|
||||
if(smelting_output_stack.isEmpty()) {
|
||||
stacks_.set(SMELTING_OUTPUT_SLOT_NO, recipe_result_items.copy());
|
||||
} else if(smelting_output_stack.getItem() == recipe_result_items.getItem()) {
|
||||
|
@ -851,6 +790,70 @@ public class BlockDecorFurnace extends BlockDecorDirected
|
|||
return super.getCapability(capability, facing);
|
||||
}
|
||||
}
|
||||
|
||||
// ITickable ------------------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public void update()
|
||||
{
|
||||
if(--tick_timer_ > 0) return;
|
||||
tick_timer_ = TICK_INTERVAL;
|
||||
final boolean was_burning = isBurning();
|
||||
if(was_burning) burntime_left_ -= TICK_INTERVAL;
|
||||
if(burntime_left_ < 0) burntime_left_ = 0;
|
||||
if(world.isRemote) return;
|
||||
boolean dirty = false;
|
||||
if(--fifo_timer_ <= 0) {
|
||||
fifo_timer_ = FIFO_INTERVAL/TICK_INTERVAL;
|
||||
// note, intentionally not using bitwise OR piping.
|
||||
if(transferItems(FIFO_OUTPUT_0_SLOT_NO, FIFO_OUTPUT_1_SLOT_NO, 1)) dirty = true;
|
||||
if(transferItems(SMELTING_OUTPUT_SLOT_NO, FIFO_OUTPUT_0_SLOT_NO, 1)) dirty = true;
|
||||
if(transferItems(FIFO_FUEL_0_SLOT_NO, SMELTING_FUEL_SLOT_NO, 1)) dirty = true;
|
||||
if(transferItems(FIFO_FUEL_1_SLOT_NO, FIFO_FUEL_0_SLOT_NO, 1)) dirty = true;
|
||||
if(transferItems(FIFO_INPUT_0_SLOT_NO, SMELTING_INPUT_SLOT_NO, 1)) dirty = true;
|
||||
if(transferItems(FIFO_INPUT_1_SLOT_NO, FIFO_INPUT_0_SLOT_NO, 1)) dirty = true;
|
||||
heater_inserted_ = (ExtItems.IE_EXTERNAL_HEATER==null) // without IE always allow electrical boost
|
||||
|| (stacks_.get(AUX_0_SLOT_NO).getItem()==ExtItems.IE_EXTERNAL_HEATER)
|
||||
|| (stacks_.get(AUX_1_SLOT_NO).getItem()==ExtItems.IE_EXTERNAL_HEATER);
|
||||
}
|
||||
ItemStack fuel = stacks_.get(SMELTING_FUEL_SLOT_NO);
|
||||
if(isBurning() || (!fuel.isEmpty()) && (!(stacks_.get(SMELTING_INPUT_SLOT_NO)).isEmpty())) {
|
||||
if(!isBurning() && canSmelt()) {
|
||||
burntime_left_ = (int)MathHelper.clamp((proc_fuel_efficiency_ * getItemBurnTime(fuel)), 0, MAX_BURNTIME);
|
||||
fuel_burntime_ = (burntime_left_ * proc_speed_interval_) / VANILLA_FURNACE_SPEED_INTERVAL;
|
||||
if(isBurning()) {
|
||||
dirty = true;
|
||||
if(!fuel.isEmpty()) {
|
||||
Item fuel_item = fuel.getItem();
|
||||
fuel.shrink(1);
|
||||
if(fuel.isEmpty()) stacks_.set(SMELTING_FUEL_SLOT_NO, fuel_item.getContainerItem(fuel));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isBurning() && canSmelt()) {
|
||||
proc_time_elapsed_ += TICK_INTERVAL;
|
||||
if(heater_inserted_ && (boost_energy_ >= boost_energy_consumption)) { boost_energy_ = 0; proc_time_elapsed_ += TICK_INTERVAL; }
|
||||
if(proc_time_elapsed_ >= proc_time_needed_) {
|
||||
proc_time_elapsed_ = 0;
|
||||
proc_time_needed_ = getCookTime(stacks_.get(SMELTING_INPUT_SLOT_NO));
|
||||
smeltItem();
|
||||
dirty = true;
|
||||
}
|
||||
} else {
|
||||
proc_time_elapsed_ = 0;
|
||||
}
|
||||
} else if(!isBurning() && (proc_time_elapsed_ > 0)) {
|
||||
proc_time_elapsed_ = MathHelper.clamp(proc_time_elapsed_-2, 0, proc_time_needed_);
|
||||
}
|
||||
if(was_burning != isBurning()) {
|
||||
dirty = true;
|
||||
final IBlockState state = world.getBlockState(pos);
|
||||
if(state.getBlock() instanceof BlockDecorFurnace) {
|
||||
world.setBlockState(pos, state.withProperty(LIT, isBurning()));
|
||||
}
|
||||
}
|
||||
if(dirty) markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -0,0 +1,683 @@
|
|||
/*
|
||||
* @file BlockDecorFurnaceElectrical.java
|
||||
* @author Stefan Wilhelm (wile)
|
||||
* @copyright (C) 2019 Stefan Wilhelm
|
||||
* @license MIT (see https://opensource.org/licenses/MIT)
|
||||
*
|
||||
* ED electrical furnace.
|
||||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.inventory.*;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
import net.minecraftforge.energy.IEnergyStorage;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockDecorFurnaceElectrical extends BlockDecorFurnace
|
||||
{
|
||||
public BlockDecorFurnaceElectrical(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB)
|
||||
{
|
||||
super(registryName, config, material, hardness, resistance, sound, unrotatedAABB);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public TileEntity createTileEntity(World world, IBlockState state)
|
||||
{ return new BlockDecorFurnaceElectrical.BTileEntity(); }
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(world.isRemote) return true;
|
||||
player.openGui(ModEngineersDecor.instance, ModEngineersDecor.GuiHandler.GUIID_ELECTRICAL_LAB_FURNACE, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
player.addStat(StatList.FURNACE_INTERACTION);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rnd)
|
||||
{}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// ModEngineersDecor.GuiHandler connectors
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public static Object getServerGuiElement(final EntityPlayer player, final World world, final BlockPos pos, final TileEntity te)
|
||||
{ return (te instanceof BTileEntity) ? (new BContainer(player.inventory, world, pos, (BTileEntity)te)) : null; }
|
||||
|
||||
public static Object getClientGuiElement(final EntityPlayer player, final World world, final BlockPos pos, final TileEntity te)
|
||||
{ return (te instanceof BTileEntity) ? (new BGui(player.inventory, world, pos, (BTileEntity)te)) : null; }
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// GUI
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static class BGui extends GuiContainer
|
||||
{
|
||||
private final BTileEntity te;
|
||||
|
||||
public BGui(InventoryPlayer playerInventory, World world, BlockPos pos, BTileEntity te)
|
||||
{ super(new BContainer(playerInventory, world, pos, te)); this.te = te; }
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{ super.initGui(); }
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
drawDefaultBackground();
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
renderHoveredToolTip(mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.getTextureManager().bindTexture(new ResourceLocation(ModEngineersDecor.MODID, "textures/gui/small_electrical_furnace_gui.png"));
|
||||
final int x0=(width-xSize)/2, y0=(height-ySize)/2, w=xSize, h=ySize;
|
||||
drawTexturedModalRect(x0, y0, 0, 0, w, h);
|
||||
if(BTileEntity.isBurning(te)) {
|
||||
if(BlockDecorFurnace.BTileEntity.isBurning(te)) {
|
||||
final int hi = 13;
|
||||
final int k = heat_px(hi);
|
||||
drawTexturedModalRect(x0+61, y0+53+hi-k, 177, hi-k, 13, k);
|
||||
}
|
||||
}
|
||||
drawTexturedModalRect(x0+79, y0+30, 176, 15, 1+progress_px(17), 15);
|
||||
int we = energy_px(32, 8);
|
||||
if(we>0) drawTexturedModalRect(x0+88, y0+53, 185, 30, we, 13);
|
||||
}
|
||||
|
||||
private int progress_px(int pixels)
|
||||
{ final int tc=te.getField(2), T=te.getField(3); return ((T>0) && (tc>0)) ? (tc * pixels / T) : (0); }
|
||||
|
||||
private int heat_px(int pixels)
|
||||
{
|
||||
int k = ((te.getField(0) * (pixels+1)) / (BlockDecorFurnaceElectrical.BTileEntity.HEAT_CAPACITY));
|
||||
return (k < pixels) ? k : pixels;
|
||||
}
|
||||
|
||||
private int energy_px(int maxwidth, int quantization)
|
||||
{
|
||||
int k = ((maxwidth * te.getField(1) * 9) / 8) / (te.getMaxEnergyStored()+1);
|
||||
k = (k >= maxwidth-2) ? maxwidth : k;
|
||||
if(quantization > 0) k = ((k+(quantization/2))/quantization) * quantization;
|
||||
return k;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// container
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public static class BContainer extends Container
|
||||
{
|
||||
private static final int PLAYER_INV_START_SLOTNO = 7;
|
||||
private final World world;
|
||||
private final BlockPos pos;
|
||||
private final EntityPlayer player;
|
||||
private final BTileEntity te;
|
||||
private int burntime_left_, energy_stored_, proc_time_elapsed_, proc_time_needed_, speed_;
|
||||
|
||||
public BContainer(InventoryPlayer playerInventory, World world, BlockPos pos, BTileEntity te)
|
||||
{
|
||||
this.player = playerInventory.player;
|
||||
this.world = world;
|
||||
this.pos = pos;
|
||||
this.te = te;
|
||||
addSlotToContainer(new Slot(te, 0, 59, 28)); // smelting input
|
||||
addSlotToContainer(new Slot(te, 1, 16, 52)); // aux
|
||||
addSlotToContainer(new BSlotResult(playerInventory.player, te, 2, 101, 28)); // smelting result
|
||||
addSlotToContainer(new BSlotInpFifo(te, 3, 34, 28)); // input fifo 0
|
||||
addSlotToContainer(new BSlotInpFifo(te, 4, 16, 28)); // input fifo 1
|
||||
addSlotToContainer(new BSlotOutFifo(playerInventory.player, te, 5, 126, 28)); // out fifo 0
|
||||
addSlotToContainer(new BSlotOutFifo(playerInventory.player, te, 6, 144, 28)); // out fifo 1
|
||||
for(int x=0; x<9; ++x) {
|
||||
addSlotToContainer(new Slot(playerInventory, x, 8+x*18, 144)); // player slots: 0..8
|
||||
}
|
||||
for(int y=0; y<3; ++y) {
|
||||
for(int x=0; x<9; ++x) {
|
||||
addSlotToContainer(new Slot(playerInventory, x+y*9+9, 8+x*18, 86+y*18)); // player slots: 9..35
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener listener)
|
||||
{ super.addListener(listener); listener.sendAllWindowProperties(this, te); }
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
super.detectAndSendChanges();
|
||||
for(int i=0; i<listeners.size(); ++i) {
|
||||
IContainerListener lis = listeners.get(i);
|
||||
if(burntime_left_ != te.getField(0)) lis.sendWindowProperty(this, 0, te.getField(0));
|
||||
if(energy_stored_ != te.getField(1)) lis.sendWindowProperty(this, 1, te.getField(1));
|
||||
if(proc_time_elapsed_ != te.getField(2)) lis.sendWindowProperty(this, 2, te.getField(2));
|
||||
if(proc_time_needed_ != te.getField(3)) lis.sendWindowProperty(this, 3, te.getField(3));
|
||||
if(speed_ != te.getField(4)) lis.sendWindowProperty(this, 4, te.getField(4));
|
||||
}
|
||||
burntime_left_ = te.getField(0);
|
||||
energy_stored_ = te.getField(1);
|
||||
proc_time_elapsed_ = te.getField(2);
|
||||
proc_time_needed_ = te.getField(3);
|
||||
speed_ = te.getField(4);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateProgressBar(int id, int data)
|
||||
{ te.setField(id, data); }
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{ return (world.getBlockState(pos).getBlock() instanceof BlockDecorFurnaceElectrical) && (player.getDistanceSq(pos) <= 64); }
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index)
|
||||
{
|
||||
Slot slot = inventorySlots.get(index);
|
||||
if((slot==null) || (!slot.getHasStack())) return ItemStack.EMPTY;
|
||||
ItemStack slot_stack = slot.getStack();
|
||||
ItemStack transferred = slot_stack.copy();
|
||||
if((index==2) || (index==5) || (index==6)) {
|
||||
// Output slots
|
||||
if(!mergeItemStack(slot_stack, PLAYER_INV_START_SLOTNO, PLAYER_INV_START_SLOTNO+36, true)) return ItemStack.EMPTY;
|
||||
slot.onSlotChange(slot_stack, transferred);
|
||||
} else if((index==0) || (index==3) || (index==4)) {
|
||||
// Input slots
|
||||
if(!mergeItemStack(slot_stack, PLAYER_INV_START_SLOTNO, PLAYER_INV_START_SLOTNO+36, false)) return ItemStack.EMPTY;
|
||||
} else if(index==1) {
|
||||
// Bypass slot
|
||||
if(!mergeItemStack(slot_stack, PLAYER_INV_START_SLOTNO, PLAYER_INV_START_SLOTNO+36, false)) return ItemStack.EMPTY;
|
||||
} else if((index >= PLAYER_INV_START_SLOTNO) && (index <= PLAYER_INV_START_SLOTNO+36)) {
|
||||
// Player inventory
|
||||
if(!BRecipes.instance().getSmeltingResult(slot_stack).isEmpty()) {
|
||||
if(
|
||||
(!mergeItemStack(slot_stack, 0, 1, false)) && // smelting input
|
||||
(!mergeItemStack(slot_stack, 3, 4, false)) && // fifo0
|
||||
(!mergeItemStack(slot_stack, 4, 5, false)) // fifo1
|
||||
) return ItemStack.EMPTY;
|
||||
} else if((index >= PLAYER_INV_START_SLOTNO) && (index < PLAYER_INV_START_SLOTNO+27)) {
|
||||
// player inventory --> player hotbar
|
||||
if(!mergeItemStack(slot_stack, PLAYER_INV_START_SLOTNO+27, PLAYER_INV_START_SLOTNO+36, false)) return ItemStack.EMPTY;
|
||||
} else if((index >= PLAYER_INV_START_SLOTNO+27) && (index < PLAYER_INV_START_SLOTNO+36) && (!mergeItemStack(slot_stack, PLAYER_INV_START_SLOTNO, PLAYER_INV_START_SLOTNO+27, false))) {
|
||||
// player hotbar --> player inventory
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
} else {
|
||||
// invalid slot
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
if(slot_stack.isEmpty()) {
|
||||
slot.putStack(ItemStack.EMPTY);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
if(slot_stack.getCount() == transferred.getCount()) return ItemStack.EMPTY;
|
||||
slot.onTake(player, slot_stack);
|
||||
return transferred;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// Tile entity
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public static class BTileEntity extends BlockDecorFurnace.BTileEntity implements ITickable, ISidedInventory, IEnergyStorage, IItemHandler
|
||||
{
|
||||
public static final int TICK_INTERVAL = 4;
|
||||
public static final int FIFO_INTERVAL = 20;
|
||||
public static final int HEAT_CAPACITY = 200;
|
||||
public static final int HEAT_INCREMENT = 20;
|
||||
public static final int MAX_ENERGY_TRANSFER = 256;
|
||||
public static final int MAX_ENERGY_BUFFER = 32000;
|
||||
public static final int MAX_SPEED_SETTING = 2;
|
||||
public static final int NUM_OF_SLOTS = 7;
|
||||
public static final int SMELTING_INPUT_SLOT_NO = 0;
|
||||
public static final int SMELTING_AUX_SLOT_NO = 1;
|
||||
public static final int SMELTING_OUTPUT_SLOT_NO = 2;
|
||||
public static final int FIFO_INPUT_0_SLOT_NO = 3;
|
||||
public static final int FIFO_INPUT_1_SLOT_NO = 4;
|
||||
public static final int FIFO_OUTPUT_0_SLOT_NO = 5;
|
||||
public static final int FIFO_OUTPUT_1_SLOT_NO = 6;
|
||||
public static final int DEFAULT_SPEED_PERCENT = 200;
|
||||
public static final int DEFAULT_ENERGY_CONSUMPTION = 16 ;
|
||||
public static final int DEFAULT_SCALED_ENERGY_CONSUMPTION = DEFAULT_ENERGY_CONSUMPTION * HEAT_INCREMENT * DEFAULT_SPEED_PERCENT/100;
|
||||
|
||||
private static int energy_consumption_ = DEFAULT_SCALED_ENERGY_CONSUMPTION;
|
||||
private static int transfer_energy_consumption_ = DEFAULT_SCALED_ENERGY_CONSUMPTION/8;
|
||||
private static int proc_speed_percent_ = DEFAULT_SPEED_PERCENT;
|
||||
private int burntime_left_;
|
||||
private int proc_time_elapsed_;
|
||||
private int proc_time_needed_;
|
||||
private int energy_stored_;
|
||||
private int speed_;
|
||||
private int tick_timer_;
|
||||
private int fifo_timer_;
|
||||
|
||||
public static void on_config(int speed_percent, int standard_energy_per_tick)
|
||||
{
|
||||
proc_speed_percent_ = MathHelper.clamp(speed_percent, 10, 500);
|
||||
energy_consumption_ = MathHelper.clamp(standard_energy_per_tick, 10, 256) * HEAT_INCREMENT * proc_speed_percent_ / 100;
|
||||
transfer_energy_consumption_ = MathHelper.clamp(energy_consumption_/8, 8, HEAT_INCREMENT);
|
||||
ModEngineersDecor.logger.info("Config electrical furnace speed:" + proc_speed_percent_ + ", power consumption:" + energy_consumption_);
|
||||
}
|
||||
|
||||
public BTileEntity()
|
||||
{ super(); reset(); }
|
||||
|
||||
public void reset()
|
||||
{
|
||||
stacks_ = NonNullList.<ItemStack>withSize(NUM_OF_SLOTS, ItemStack.EMPTY);
|
||||
burntime_left_ = 0;
|
||||
proc_time_elapsed_ = 0;
|
||||
proc_time_needed_ = 0;
|
||||
fifo_timer_ = 0;
|
||||
tick_timer_ = 0;
|
||||
energy_stored_= 0;
|
||||
speed_ = 0;
|
||||
}
|
||||
|
||||
public void readnbt(NBTTagCompound compound)
|
||||
{
|
||||
reset();
|
||||
ItemStackHelper.loadAllItems(compound, this.stacks_);
|
||||
while(this.stacks_.size() < NUM_OF_SLOTS) this.stacks_.add(ItemStack.EMPTY);
|
||||
burntime_left_ = compound.getInteger("BurnTime");
|
||||
proc_time_elapsed_ = compound.getInteger("CookTime");
|
||||
proc_time_needed_ = compound.getInteger("CookTimeTotal");
|
||||
energy_stored_ = compound.getInteger("Energy");
|
||||
speed_ = compound.getInteger("SpeedSetting");
|
||||
}
|
||||
|
||||
protected void writenbt(NBTTagCompound compound)
|
||||
{
|
||||
compound.setInteger("BurnTime", MathHelper.clamp(burntime_left_,0 , HEAT_CAPACITY));
|
||||
compound.setInteger("CookTime", MathHelper.clamp(proc_time_elapsed_, 0, MAX_BURNTIME));
|
||||
compound.setInteger("CookTimeTotal", MathHelper.clamp(proc_time_needed_, 0, MAX_BURNTIME));
|
||||
compound.setInteger("Energy", MathHelper.clamp(energy_stored_,0 , MAX_ENERGY_BUFFER));
|
||||
compound.setInteger("SpeedSetting", MathHelper.clamp(speed_, -1, MAX_SPEED_SETTING));
|
||||
ItemStackHelper.saveAllItems(compound, stacks_);
|
||||
}
|
||||
|
||||
// TileEntity ------------------------------------------------------------------------------
|
||||
// IWorldNamable ---------------------------------------------------------------------------
|
||||
// IInventory ------------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int index, ItemStack stack)
|
||||
{
|
||||
switch(index) {
|
||||
case SMELTING_INPUT_SLOT_NO:
|
||||
case FIFO_INPUT_0_SLOT_NO:
|
||||
case FIFO_INPUT_1_SLOT_NO:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getField(int id)
|
||||
{
|
||||
switch (id) {
|
||||
case 0: return burntime_left_;
|
||||
case 1: return energy_stored_;
|
||||
case 2: return proc_time_elapsed_;
|
||||
case 3: return proc_time_needed_;
|
||||
case 4: return speed_;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setField(int id, int value)
|
||||
{
|
||||
switch(id) {
|
||||
case 0: burntime_left_ = value; break;
|
||||
case 1: energy_stored_ = value; break;
|
||||
case 2: proc_time_elapsed_ = value; break;
|
||||
case 3: proc_time_needed_ = value; break;
|
||||
case 4: speed_ = value; break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFieldCount()
|
||||
{ return 7; }
|
||||
|
||||
public boolean isBurning()
|
||||
{ return burntime_left_ > 0; }
|
||||
|
||||
private boolean transferItems(final int index_from, final int index_to, int count)
|
||||
{
|
||||
ItemStack from = stacks_.get(index_from);
|
||||
if(from.isEmpty()) return false;
|
||||
ItemStack to = stacks_.get(index_to);
|
||||
if(from.getCount() < count) count = from.getCount();
|
||||
if(count <= 0) return false;
|
||||
boolean changed = true;
|
||||
if(to.isEmpty()) {
|
||||
stacks_.set(index_to, from.splitStack(count));
|
||||
} else if(to.getCount() >= to.getMaxStackSize()) {
|
||||
changed = false;
|
||||
} else if((!from.isItemEqual(to)) || (!ItemStack.areItemStackTagsEqual(from, to))) {
|
||||
changed = false;
|
||||
} else {
|
||||
if((to.getCount()+count) >= to.getMaxStackSize()) {
|
||||
from.shrink(to.getMaxStackSize()-to.getCount());
|
||||
to.setCount(to.getMaxStackSize());
|
||||
} else {
|
||||
from.shrink(count);
|
||||
to.grow(count);
|
||||
}
|
||||
}
|
||||
if(from.isEmpty() && from!=ItemStack.EMPTY) {
|
||||
stacks_.set(index_from, ItemStack.EMPTY);
|
||||
changed = true;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
// ISidedInventory ----------------------------------------------------------------------------
|
||||
|
||||
private static final int[] SIDED_INV_SLOTS = new int[] {
|
||||
SMELTING_INPUT_SLOT_NO, SMELTING_AUX_SLOT_NO, SMELTING_OUTPUT_SLOT_NO,
|
||||
FIFO_INPUT_0_SLOT_NO, FIFO_INPUT_1_SLOT_NO, FIFO_OUTPUT_0_SLOT_NO, FIFO_OUTPUT_1_SLOT_NO
|
||||
};
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{ return SIDED_INV_SLOTS; }
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction)
|
||||
{ return isItemValidForSlot(index, itemStackIn); }
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction)
|
||||
{ return ((index!=SMELTING_INPUT_SLOT_NO) && (index!=FIFO_INPUT_0_SLOT_NO) && (index!=FIFO_INPUT_1_SLOT_NO)) || (stack.getItem()==Items.BUCKET); }
|
||||
|
||||
// IEnergyStorage ----------------------------------------------------------------------------
|
||||
|
||||
public boolean canExtract()
|
||||
{ return false; }
|
||||
|
||||
public boolean canReceive()
|
||||
{ return true; }
|
||||
|
||||
public int getMaxEnergyStored()
|
||||
{ return MAX_ENERGY_BUFFER; }
|
||||
|
||||
public int getEnergyStored()
|
||||
{ return energy_stored_; }
|
||||
|
||||
public int extractEnergy(int maxExtract, boolean simulate)
|
||||
{ return 0; }
|
||||
|
||||
public int receiveEnergy(int maxReceive, boolean simulate)
|
||||
{
|
||||
if(energy_stored_ >= MAX_ENERGY_BUFFER) return 0;
|
||||
int n = Math.min(maxReceive, (MAX_ENERGY_BUFFER - energy_stored_));
|
||||
if(n > MAX_ENERGY_TRANSFER) n = MAX_ENERGY_TRANSFER;
|
||||
if(!simulate) {energy_stored_ += n; markDirty(); }
|
||||
return n;
|
||||
}
|
||||
|
||||
// IItemHandler --------------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public int getSlots()
|
||||
{ return SIDED_INV_SLOTS.length; }
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack getStackInSlot(int index)
|
||||
{ return ((index < 0) || (index >= SIDED_INV_SLOTS.length)) ? ItemStack.EMPTY : stacks_.get(SIDED_INV_SLOTS[index]); }
|
||||
|
||||
@Override
|
||||
public int getSlotLimit(int index)
|
||||
{ return getInventoryStackLimit(); }
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(int slot, @Nonnull ItemStack stack)
|
||||
{ return true; }
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack insertItem(int index, @Nonnull ItemStack stack, boolean simulate)
|
||||
{
|
||||
if(stack.isEmpty()) return ItemStack.EMPTY;
|
||||
if((index < 0) || (index >= SIDED_INV_SLOTS.length)) return ItemStack.EMPTY;
|
||||
int slotno = SIDED_INV_SLOTS[index];
|
||||
ItemStack slotstack = getStackInSlot(slotno);
|
||||
if(!slotstack.isEmpty())
|
||||
{
|
||||
if(slotstack.getCount() >= Math.min(slotstack.getMaxStackSize(), getSlotLimit(index))) return stack;
|
||||
if(!ItemHandlerHelper.canItemStacksStack(stack, slotstack)) return stack;
|
||||
if(!canInsertItem(slotno, stack, EnumFacing.UP) || (!isItemValidForSlot(slotno, stack))) return stack;
|
||||
int n = Math.min(stack.getMaxStackSize(), getSlotLimit(index)) - slotstack.getCount();
|
||||
if(stack.getCount() <= n) {
|
||||
if(!simulate) {
|
||||
ItemStack copy = stack.copy();
|
||||
copy.grow(slotstack.getCount());
|
||||
setInventorySlotContents(slotno, copy);
|
||||
}
|
||||
return ItemStack.EMPTY;
|
||||
} else {
|
||||
stack = stack.copy();
|
||||
if(!simulate) {
|
||||
ItemStack copy = stack.splitStack(n);
|
||||
copy.grow(slotstack.getCount());
|
||||
setInventorySlotContents(slotno, copy);
|
||||
return stack;
|
||||
} else {
|
||||
stack.shrink(n);
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(!canInsertItem(slotno, stack, EnumFacing.UP) || (!isItemValidForSlot(slotno, stack))) return stack;
|
||||
int n = Math.min(stack.getMaxStackSize(), getSlotLimit(index));
|
||||
if(n < stack.getCount()) {
|
||||
stack = stack.copy();
|
||||
if(!simulate) {
|
||||
setInventorySlotContents(slotno, stack.splitStack(n));
|
||||
return stack;
|
||||
} else {
|
||||
stack.shrink(n);
|
||||
return stack;
|
||||
}
|
||||
} else {
|
||||
if(!simulate) setInventorySlotContents(slotno, stack);
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack extractItem(int index, int amount, boolean simulate)
|
||||
{
|
||||
if(amount == 0) return ItemStack.EMPTY;
|
||||
if((index < 0) || (index >= SIDED_INV_SLOTS.length)) return ItemStack.EMPTY;
|
||||
int slotno = SIDED_INV_SLOTS[index];
|
||||
ItemStack stackInSlot = getStackInSlot(slotno);
|
||||
if(stackInSlot.isEmpty()) return ItemStack.EMPTY;
|
||||
if(!canExtractItem(slotno, stackInSlot, EnumFacing.DOWN)) return ItemStack.EMPTY;
|
||||
if(simulate) {
|
||||
if(stackInSlot.getCount() < amount) return stackInSlot.copy();
|
||||
ItemStack ostack = stackInSlot.copy();
|
||||
ostack.setCount(amount);
|
||||
return ostack;
|
||||
} else {
|
||||
ItemStack ostack = decrStackSize(slotno, Math.min(stackInSlot.getCount(), amount));
|
||||
markDirty();
|
||||
return ostack;
|
||||
}
|
||||
}
|
||||
|
||||
// Capability export ----------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public boolean hasCapability(Capability<?> cap, EnumFacing facing)
|
||||
{ return ((cap==CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) || (cap==CapabilityEnergy.ENERGY)) || super.hasCapability(cap, facing); }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Nullable
|
||||
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing)
|
||||
{
|
||||
if((capability == CapabilityEnergy.ENERGY) || (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)) {
|
||||
return ((T)this);
|
||||
} else {
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
}
|
||||
|
||||
// ITickable ------------------------------------------------------------------------------------
|
||||
|
||||
private boolean adjacent_inventory_shift(boolean inp, boolean out)
|
||||
{
|
||||
boolean dirty = false;
|
||||
if(energy_stored_ < transfer_energy_consumption_) return false;
|
||||
final IBlockState state = world.getBlockState(pos);
|
||||
if(!(state.getBlock() instanceof BlockDecorFurnaceElectrical)) return false;
|
||||
final EnumFacing out_facing = state.getValue(FACING);
|
||||
final EnumFacing inp_facing = state.getValue(FACING).getOpposite();
|
||||
if(out && (!stacks_.get(FIFO_OUTPUT_1_SLOT_NO).isEmpty())) {
|
||||
TileEntity te = world.getTileEntity(pos.offset(out_facing));
|
||||
if((te!=null) && (te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, inp_facing))) {
|
||||
IItemHandler hnd = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, inp_facing);
|
||||
ItemStack remaining = ItemHandlerHelper.insertItemStacked(hnd, stacks_.get(FIFO_OUTPUT_1_SLOT_NO).copy(), false);
|
||||
stacks_.set(FIFO_OUTPUT_1_SLOT_NO, remaining);
|
||||
energy_stored_ -= transfer_energy_consumption_;
|
||||
dirty = true;
|
||||
}
|
||||
}
|
||||
if(inp && (stacks_.get(FIFO_INPUT_1_SLOT_NO).isEmpty())) {
|
||||
TileEntity te = world.getTileEntity(pos.offset(inp_facing));
|
||||
if((te!=null) && (te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, out_facing))) {
|
||||
IItemHandler hnd = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, out_facing);
|
||||
for(int i=0; i< hnd.getSlots(); ++i) {
|
||||
ItemStack adj_stack = hnd.getStackInSlot(i);
|
||||
if(!adj_stack.isEmpty()) {
|
||||
ItemStack my_stack = adj_stack.copy();
|
||||
if(my_stack.getCount() > getInventoryStackLimit()) my_stack.setCount(getInventoryStackLimit());
|
||||
adj_stack.shrink(my_stack.getCount());
|
||||
stacks_.set(FIFO_INPUT_1_SLOT_NO, my_stack);
|
||||
energy_stored_ -= transfer_energy_consumption_;
|
||||
dirty = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return dirty;
|
||||
}
|
||||
|
||||
// returns TE dirty
|
||||
private boolean heat_up()
|
||||
{
|
||||
if(energy_stored_ < (energy_consumption_)) return false;
|
||||
if(burntime_left_ >= (HEAT_CAPACITY-HEAT_INCREMENT)) return false;
|
||||
energy_stored_ -= energy_consumption_;
|
||||
burntime_left_ += HEAT_INCREMENT;
|
||||
this.markDirty();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update()
|
||||
{
|
||||
if(--tick_timer_ > 0) return;
|
||||
tick_timer_ = TICK_INTERVAL;
|
||||
final boolean was_burning = isBurning();
|
||||
if(was_burning) burntime_left_ -= TICK_INTERVAL;
|
||||
if(burntime_left_ < 0) burntime_left_ = 0;
|
||||
if(world.isRemote) return;
|
||||
boolean dirty = false;
|
||||
boolean shift_in = false;
|
||||
boolean shift_out = false;
|
||||
if(--fifo_timer_ <= 0) {
|
||||
fifo_timer_ = FIFO_INTERVAL/TICK_INTERVAL;
|
||||
if(transferItems(FIFO_OUTPUT_0_SLOT_NO, FIFO_OUTPUT_1_SLOT_NO, 64)) { dirty = true; } else { shift_out = true; }
|
||||
if(transferItems(SMELTING_OUTPUT_SLOT_NO, FIFO_OUTPUT_0_SLOT_NO, 64)) dirty = true;
|
||||
if(transferItems(FIFO_INPUT_0_SLOT_NO, SMELTING_INPUT_SLOT_NO, 64)) dirty = true;
|
||||
if(transferItems(FIFO_INPUT_1_SLOT_NO, FIFO_INPUT_0_SLOT_NO, 64)) { dirty = true; } else { shift_in = true; }
|
||||
}
|
||||
if((!(stacks_.get(SMELTING_INPUT_SLOT_NO)).isEmpty()) && (energy_stored_ >= energy_consumption_)) {
|
||||
final boolean can_smelt = canSmelt();
|
||||
if((!can_smelt) && (BRecipes.instance().getSmeltingResult(stacks_.get(SMELTING_INPUT_SLOT_NO)).isEmpty())) {
|
||||
// bypass
|
||||
if(transferItems(SMELTING_INPUT_SLOT_NO, SMELTING_OUTPUT_SLOT_NO, 1)) dirty = true;
|
||||
} else {
|
||||
// smelt
|
||||
if(!isBurning() && can_smelt) {
|
||||
if(heat_up()) dirty = true;
|
||||
}
|
||||
if(isBurning() && can_smelt) {
|
||||
if(heat_up()) dirty = true;
|
||||
proc_time_elapsed_ += (TICK_INTERVAL * proc_speed_percent_/100);
|
||||
if(proc_time_elapsed_ >= proc_time_needed_) {
|
||||
proc_time_elapsed_ = 0;
|
||||
proc_time_needed_ = getCookTime(stacks_.get(SMELTING_INPUT_SLOT_NO));
|
||||
smeltItem();
|
||||
dirty = true;
|
||||
shift_out = true;
|
||||
}
|
||||
} else {
|
||||
proc_time_elapsed_ = 0;
|
||||
}
|
||||
}
|
||||
} else if(proc_time_elapsed_ > 0) {
|
||||
proc_time_elapsed_ -= ((stacks_.get(SMELTING_INPUT_SLOT_NO)).isEmpty() ? 20 : 1);
|
||||
if(proc_time_elapsed_ < 0) { proc_time_elapsed_ = 0; shift_out = true; }
|
||||
}
|
||||
if(was_burning != isBurning()) {
|
||||
dirty = true;
|
||||
final IBlockState state = world.getBlockState(pos);
|
||||
if(state.getBlock() instanceof BlockDecorFurnace) {
|
||||
world.setBlockState(pos, state.withProperty(LIT, isBurning()));
|
||||
}
|
||||
}
|
||||
if(adjacent_inventory_shift(shift_in, shift_out)) dirty = true;
|
||||
if(dirty) markDirty();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -39,7 +39,6 @@ public class BlockDecorGlassBlock extends BlockDecor
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
final IBlockState neighbourState = world.getBlockState(pos.offset(side));
|
||||
|
@ -50,25 +49,23 @@ public class BlockDecorGlassBlock extends BlockDecor
|
|||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("deprecation")
|
||||
public float getAmbientOcclusionLightValue(IBlockState state)
|
||||
{ return 1.0F; }
|
||||
{ return 0.9F; }
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{ return false; }
|
||||
{ return true; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isNormalCube(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
public int getLightOpacity(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{ return 0; }
|
||||
{ return 2; }
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
|
@ -79,12 +76,10 @@ public class BlockDecorGlassBlock extends BlockDecor
|
|||
{ return false; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing face)
|
||||
{ return BlockFaceShape.SOLID; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{ return FULL_BLOCK_AABB; }
|
||||
|
||||
|
|
|
@ -0,0 +1,144 @@
|
|||
/*
|
||||
* @file BlockDecorHorizontalSupport.java
|
||||
* @author Stefan Wilhelm (wile)
|
||||
* @copyright (C) 2019 Stefan Wilhelm
|
||||
* @license MIT (see https://opensource.org/licenses/MIT)
|
||||
*
|
||||
* Horizontal ceiling support. Symmetric x axis, fixed in
|
||||
* xz plane, therefore boolean placement state.
|
||||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import wile.engineersdecor.detail.ModAuxiliaries;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.util.Mirror;
|
||||
import net.minecraft.util.Rotation;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
public class BlockDecorHorizontalSupport extends BlockDecor
|
||||
{
|
||||
public static final PropertyBool EASTWEST = PropertyBool.create("eastwest");
|
||||
public static final PropertyBool LEFTBEAM = PropertyBool.create("leftbeam");
|
||||
public static final PropertyBool RIGHTBEAM = PropertyBool.create("rightbeam");
|
||||
public static final PropertyInteger DOWNCONNECT = PropertyInteger.create("downconnect", 0, 2);
|
||||
protected final ArrayList<AxisAlignedBB> AABBs;
|
||||
|
||||
public BlockDecorHorizontalSupport(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB)
|
||||
{
|
||||
super(registryName, config|CFG_HORIZIONTAL, material, hardness, resistance, sound);
|
||||
final boolean is_horizontal = ((config & CFG_HORIZIONTAL)!=0);
|
||||
AABBs = new ArrayList<AxisAlignedBB>(Arrays.asList(
|
||||
// Effective bounding box
|
||||
ModAuxiliaries.getRotatedAABB(unrotatedAABB.grow(2.0/16, 0, 0), EnumFacing.NORTH, true),
|
||||
ModAuxiliaries.getRotatedAABB(unrotatedAABB.grow(2.0/16, 0, 0), EnumFacing.WEST, true),
|
||||
// Displayed bounding box
|
||||
ModAuxiliaries.getRotatedAABB(unrotatedAABB, EnumFacing.NORTH, true),
|
||||
ModAuxiliaries.getRotatedAABB(unrotatedAABB, EnumFacing.WEST, true)
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
public boolean canCreatureSpawn(IBlockState state, IBlockAccess world, BlockPos pos, net.minecraft.entity.EntityLiving.SpawnPlacementType type)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing face)
|
||||
{ return BlockFaceShape.UNDEFINED; }
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos)
|
||||
{ return AABBs.get(state.getValue(EASTWEST) ? 0x3 : 0x2).offset(pos); }
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{ return AABBs.get(state.getValue(EASTWEST) ? 0x1 : 0x0); }
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{ return getBoundingBox(state, world, pos); }
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{ return getDefaultState().withProperty(EASTWEST, ((meta & 0x1) != 0)); }
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{ return (state.getValue(EASTWEST) ? 0x1:0x0); }
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
boolean ew = state.getValue(EASTWEST);
|
||||
final IBlockState rstate = world.getBlockState((!ew) ? (pos.east()) : (pos.south()) );
|
||||
final IBlockState lstate = world.getBlockState((!ew) ? (pos.west()) : (pos.north()) );
|
||||
final IBlockState dstate = world.getBlockState(pos.down());
|
||||
int down_connector = 0;
|
||||
if((dstate.getBlock() instanceof BlockDecorStraightPole)) {
|
||||
final EnumFacing dfacing = dstate.getValue(BlockDecorStraightPole.FACING);
|
||||
final BlockDecorStraightPole pole = (BlockDecorStraightPole)dstate.getBlock();
|
||||
if((dfacing.getAxis() == EnumFacing.Axis.Y)) {
|
||||
if((pole==ModBlocks.THICK_STEEL_POLE) || ((pole==ModBlocks.THICK_STEEL_POLE_HEAD) && (dfacing==EnumFacing.UP))) {
|
||||
down_connector = 2;
|
||||
} else if((pole==ModBlocks.THIN_STEEL_POLE) || ((pole==ModBlocks.THIN_STEEL_POLE_HEAD) && (dfacing==EnumFacing.UP))) {
|
||||
down_connector = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return state.withProperty(RIGHTBEAM, (rstate.getBlock()==this) && (rstate.getValue(EASTWEST) != ew))
|
||||
.withProperty(LEFTBEAM , (lstate.getBlock()==this) && (lstate.getValue(EASTWEST) != ew))
|
||||
.withProperty(DOWNCONNECT , down_connector);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{ return new BlockStateContainer(this, EASTWEST, RIGHTBEAM, LEFTBEAM, DOWNCONNECT); }
|
||||
|
||||
@Override
|
||||
public IBlockState withRotation(IBlockState state, Rotation rot)
|
||||
{ return (rot==Rotation.CLOCKWISE_180) ? state : state.withProperty(EASTWEST, !state.getValue(EASTWEST)); }
|
||||
|
||||
@Override
|
||||
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
|
||||
{ return state; }
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side)
|
||||
{ return super.canPlaceBlockOnSide(world, pos, side); }
|
||||
|
||||
@Override
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand)
|
||||
{ return getActualState(getDefaultState().withProperty(EASTWEST, (placer.getHorizontalFacing().getAxis()==EnumFacing.Axis.X)), world, pos); }
|
||||
|
||||
}
|
|
@ -0,0 +1,267 @@
|
|||
/*
|
||||
* @file BlockDecorPassiveFluidAccumulator.java
|
||||
* @author Stefan Wilhelm (wile)
|
||||
* @copyright (C) 2019 Stefan Wilhelm
|
||||
* @license MIT (see https://opensource.org/licenses/MIT)
|
||||
*
|
||||
* A device that collects fluids from adjacent tank outputs
|
||||
* when a pump drains on the (only) output side. Shall support
|
||||
* high flow rates, and a vavuum suction delay. Shall not drain
|
||||
* high amounts of fluid from the adjacent tanks when no fluid
|
||||
* is requested at the output port. Shall drain balanced from
|
||||
* the adjacent input sides.
|
||||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.detail.ModAuxiliaries;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidTankProperties;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
public class BlockDecorPassiveFluidAccumulator extends BlockDecorDirected implements ModAuxiliaries.IExperimentalFeature
|
||||
{
|
||||
public BlockDecorPassiveFluidAccumulator(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB)
|
||||
{ super(registryName, config, material, hardness, resistance, sound, unrotatedAABB); }
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state)
|
||||
{ return true; }
|
||||
|
||||
@Nullable
|
||||
public TileEntity createTileEntity(World world, IBlockState state)
|
||||
{ return new BlockDecorPassiveFluidAccumulator.BTileEntity(); }
|
||||
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(world.isRemote) return true;
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
if(!(te instanceof BTileEntity)) return true;
|
||||
((BTileEntity)te).debug_info_dump(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos)
|
||||
{ TileEntity te = world.getTileEntity(pos); if(te instanceof BlockDecorPipeValve.BTileEntity) ((BTileEntity)te).block_changed(); }
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// Tile entity
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public static class BTileEntity extends TileEntity implements IFluidHandler, IFluidTankProperties, ICapabilityProvider, ITickable, ModAuxiliaries.IExperimentalFeature
|
||||
{
|
||||
protected static int tick_idle_interval = 20; // ca 1000ms, simulates suction delay and saves CPU when not drained.
|
||||
protected static int max_flowrate = 1000;
|
||||
private final IFluidTankProperties[] fluid_props_ = {this};
|
||||
private final InputFillHandler fill_handler_ = new InputFillHandler(this);
|
||||
private EnumFacing block_facing_ = EnumFacing.NORTH;
|
||||
private FluidStack tank_ = null;
|
||||
private int last_drain_request_amount_ = 0;
|
||||
private int vacuum_ = 0;
|
||||
private int tick_timer_ = 0;
|
||||
private int round_robin_ = 0;
|
||||
private boolean initialized_ = false;
|
||||
|
||||
|
||||
private int total_volume_filled_ = 0;
|
||||
private int total_volume_drained_ = 0;
|
||||
@Deprecated
|
||||
public void debug_info_dump(EntityPlayer player)
|
||||
{
|
||||
int t_vol = (tank_==null) ? 0 : (tank_.amount);
|
||||
ModAuxiliaries.playerChatMessage(player,"pfacc I:" + total_volume_filled_ + " O:" + total_volume_drained_ + " B:" + t_vol);
|
||||
}
|
||||
|
||||
public void block_changed()
|
||||
{ initialized_ = false; tick_timer_ = MathHelper.clamp(tick_timer_ , 0, tick_idle_interval); }
|
||||
|
||||
// Output flow handler ---------------------------------------------------------------------
|
||||
|
||||
private static class InputFillHandler implements IFluidHandler, IFluidTankProperties
|
||||
{
|
||||
private final BTileEntity parent_;
|
||||
private final IFluidTankProperties[] props_ = {this};
|
||||
InputFillHandler(BTileEntity parent) { parent_ = parent; }
|
||||
@Override public int fill(FluidStack resource, boolean doFill) { return 0; }
|
||||
@Override @Nullable public FluidStack drain(FluidStack resource, boolean doDrain) { return null; }
|
||||
@Override @Nullable public FluidStack drain(int maxDrain, boolean doDrain) { return null; }
|
||||
@Override @Nullable public FluidStack getContents() { return null; }
|
||||
@Override public IFluidTankProperties[] getTankProperties() { return props_; }
|
||||
@Override public int getCapacity() { return max_flowrate; }
|
||||
@Override public boolean canFill() { return true; }
|
||||
@Override public boolean canDrain() { return false; }
|
||||
@Override public boolean canFillFluidType(FluidStack fluidStack) { return true; }
|
||||
@Override public boolean canDrainFluidType(FluidStack fluidStack) { return false; }
|
||||
}
|
||||
|
||||
// TileEntity ------------------------------------------------------------------------------
|
||||
|
||||
public BTileEntity()
|
||||
{}
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(World world, BlockPos pos, IBlockState os, IBlockState ns)
|
||||
{
|
||||
block_changed();
|
||||
return (os.getBlock() != ns.getBlock()) || (!(ns.getBlock() instanceof BlockDecorPipeValve));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
tank_ = (!nbt.hasKey("tank")) ? (null) : (FluidStack.loadFluidStackFromNBT(nbt.getCompoundTag("tank")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.writeToNBT(nbt);
|
||||
if(tank_ != null) nbt.setTag("tank", tank_.writeToNBT(new NBTTagCompound()));
|
||||
return nbt;
|
||||
}
|
||||
|
||||
// ICapabilityProvider --------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public boolean hasCapability(@Nonnull Capability<?> capability, @Nullable EnumFacing facing)
|
||||
{ return (initialized_ && (capability==CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)) || super.hasCapability(capability, facing); }
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing facing)
|
||||
{
|
||||
if(capability != CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) return super.getCapability(capability, facing);
|
||||
return (facing==block_facing_) ? (((T)this)) : ((T)fill_handler_);
|
||||
}
|
||||
|
||||
// IFluidHandler of the output port --------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public IFluidTankProperties[] getTankProperties()
|
||||
{ return fluid_props_; }
|
||||
|
||||
@Override
|
||||
public int fill(FluidStack resource, boolean doFill)
|
||||
{ return 0; }
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public FluidStack drain(FluidStack resource, boolean doDrain)
|
||||
{
|
||||
if((resource==null) || (tank_==null)) return null;
|
||||
return (!(tank_.isFluidEqual(resource))) ? (null) : drain(resource.amount, doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public FluidStack drain(int maxDrain, boolean doDrain)
|
||||
{
|
||||
if(!initialized_) return null;
|
||||
if(doDrain && (maxDrain > 0)) last_drain_request_amount_ = maxDrain;
|
||||
if(tank_==null) return null;
|
||||
maxDrain = MathHelper.clamp(maxDrain ,0 , tank_.amount);
|
||||
if(!doDrain) return tank_.copy();
|
||||
FluidStack res = tank_.copy();
|
||||
res.amount = maxDrain;
|
||||
tank_.amount -= maxDrain;
|
||||
if(tank_.amount <= 0) tank_= null;
|
||||
total_volume_drained_ += res.amount;
|
||||
return res;
|
||||
}
|
||||
|
||||
// IFluidTankProperties --------------------------------------------------------------------
|
||||
|
||||
@Override @Nullable public FluidStack getContents() { return (tank_==null) ? (null) : (tank_.copy()); }
|
||||
@Override public int getCapacity() { return max_flowrate; }
|
||||
@Override public boolean canFill() { return false; }
|
||||
@Override public boolean canDrain() { return true; }
|
||||
@Override public boolean canFillFluidType(FluidStack fluidStack) { return false; }
|
||||
@Override public boolean canDrainFluidType(FluidStack fluidStack) { return true; }
|
||||
|
||||
// ITickable--------------------------------------------------------------------------------
|
||||
|
||||
public void update()
|
||||
{
|
||||
if((world.isRemote) || (--tick_timer_ > 0)) return;
|
||||
tick_timer_ = tick_idle_interval;
|
||||
if(!initialized_) {
|
||||
initialized_ = true;
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
if((state==null) || (!(state.getBlock() instanceof BlockDecorPassiveFluidAccumulator))) return;
|
||||
block_facing_ = state.getValue(FACING);
|
||||
}
|
||||
int n_requested = last_drain_request_amount_;
|
||||
last_drain_request_amount_ = 0;
|
||||
if(n_requested > 0) {
|
||||
vacuum_ += 2;
|
||||
if(vacuum_ > 5) vacuum_ = 5;
|
||||
} else {
|
||||
if((--vacuum_) <= 0) {
|
||||
vacuum_ = 0;
|
||||
if(tank_!=null) {
|
||||
return; // nothing to do, noone's draining.
|
||||
} else {
|
||||
n_requested = 10; // drip in
|
||||
}
|
||||
}
|
||||
}
|
||||
boolean has_refilled = false;
|
||||
n_requested += (vacuum_ * 50);
|
||||
int tank_buffer_needed = n_requested;
|
||||
if(tank_buffer_needed > max_flowrate) tank_buffer_needed = max_flowrate;
|
||||
for(int i=0; i<6; ++i) {
|
||||
if(++round_robin_ > 5) round_robin_ = 0;
|
||||
if(n_requested <= 0) break;
|
||||
if(((tank_!=null) && (tank_.amount >= tank_buffer_needed))) break;
|
||||
final EnumFacing f = EnumFacing.byIndex(round_robin_);
|
||||
if(f == block_facing_) continue;
|
||||
final TileEntity te = world.getTileEntity(pos.offset(f));
|
||||
if((te==null) || (te instanceof BTileEntity) || (!te.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, f.getOpposite()))) continue;
|
||||
final IFluidHandler fh = te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, f.getOpposite());
|
||||
if(fh==null) continue;
|
||||
if(tank_==null) {
|
||||
FluidStack res = fh.drain(n_requested, true);
|
||||
if((res == null) || (res.amount==0)) continue;
|
||||
total_volume_filled_ += res.amount;
|
||||
tank_ = res.copy();
|
||||
has_refilled = true;
|
||||
} else {
|
||||
if((tank_.amount + n_requested) > max_flowrate) n_requested = (max_flowrate - tank_.amount);
|
||||
FluidStack rq = tank_.copy();
|
||||
rq.amount = n_requested;
|
||||
FluidStack res = fh.drain(rq, true);
|
||||
if(res == null) continue;
|
||||
tank_.amount += res.amount;
|
||||
total_volume_filled_ += res.amount;
|
||||
has_refilled = true;
|
||||
if(tank_.amount >= max_flowrate) break;
|
||||
}
|
||||
}
|
||||
if(has_refilled) tick_timer_ = 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,326 @@
|
|||
/*
|
||||
* @file BlockDecorPipeValve.java
|
||||
* @author Stefan Wilhelm (wile)
|
||||
* @copyright (C) 2019 Stefan Wilhelm
|
||||
* @license MIT (see https://opensource.org/licenses/MIT)
|
||||
*
|
||||
* Basically a piece of pipe that does not connect to
|
||||
* pipes on the side, and conducts fluids only in one way.
|
||||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import blusunrize.immersiveengineering.api.fluid.IFluidPipe;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidTankProperties;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
public class BlockDecorPipeValve extends BlockDecorDirected
|
||||
{
|
||||
public static final PropertyInteger RS_CONNECTION_DIR = PropertyInteger.create("rsdir", 0,4);
|
||||
|
||||
public static void on_config(int container_size_decl, int redstone_slope)
|
||||
{
|
||||
BTileEntity.fluid_maxflow_mb = MathHelper.clamp(container_size_decl, 1, 10000);
|
||||
BTileEntity.redstone_flow_slope_mb = MathHelper.clamp(redstone_slope, 1, 10000);
|
||||
ModEngineersDecor.logger.info("Config pipe valve: maxflow:" + BTileEntity.fluid_maxflow_mb + "mb, redstone amp:" + BTileEntity.redstone_flow_slope_mb + "mb/sig");
|
||||
}
|
||||
|
||||
public BlockDecorPipeValve(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB)
|
||||
{ super(registryName, config, material, hardness, resistance, sound, unrotatedAABB); }
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{ return new BlockStateContainer(this, FACING, RS_CONNECTION_DIR); }
|
||||
|
||||
@Override
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand)
|
||||
{ return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand).withProperty(RS_CONNECTION_DIR, 0); }
|
||||
|
||||
// world to model index transformations. [Facing block][Facing neighbour] -> int 0=nothing, 1=top, 2=right, 3=down, 4=left.
|
||||
private static final int rsconnectors[][] = {
|
||||
//D U N S W E
|
||||
{0, 0, 1, 3, 4, 2}, // D
|
||||
{0, 0, 3, 1, 4, 2}, // U
|
||||
{3, 1, 0, 0, 4, 2}, // N
|
||||
{3, 1, 0, 0, 2, 4}, // S
|
||||
{3, 1, 2, 4, 0, 0}, // W
|
||||
{3, 1, 4, 2, 0, 0}, // E
|
||||
};
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
if((config & (CFG_REDSTONE_CONTROLLED))==0) return state;
|
||||
EnumFacing.Axis bfa = state.getValue(FACING).getAxis();
|
||||
int bfi = state.getValue(FACING).getIndex();
|
||||
for(EnumFacing f:EnumFacing.VALUES) {
|
||||
if(f.getAxis() == bfa) continue;
|
||||
BlockPos nbp = pos.offset(f);
|
||||
IBlockState nbs = world.getBlockState(nbp);
|
||||
if(nbs.canProvidePower()) return state.withProperty(RS_CONNECTION_DIR, rsconnectors[state.getValue(FACING).getIndex()][f.getIndex()]);
|
||||
}
|
||||
return state.withProperty(RS_CONNECTION_DIR, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos)
|
||||
{
|
||||
EnumFacing fc = state.getValue(FACING);
|
||||
if(fromPos.equals(pos.offset(fc)) || fromPos.equals(pos.offset(fc.getOpposite()))) update_te(world, state, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
|
||||
{
|
||||
update_te(world, state, pos);
|
||||
world.notifyNeighborsOfStateChange(pos, this, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face)
|
||||
{ return BlockFaceShape.SOLID; }
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side)
|
||||
{ return (side!=null) && (side!=state.getValue(FACING)) && (side!=state.getValue(FACING).getOpposite()); }
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state)
|
||||
{ return true; }
|
||||
|
||||
@Nullable
|
||||
public TileEntity createTileEntity(World world, IBlockState state)
|
||||
{ return new BlockDecorPipeValve.BTileEntity(); }
|
||||
|
||||
private void update_te(World world, IBlockState state, BlockPos pos)
|
||||
{
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
if(te instanceof BlockDecorPipeValve.BTileEntity) ((BlockDecorPipeValve.BTileEntity)te).block_reconfigure(state.getValue(FACING), config);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// Tile entity
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public static class BTileEntity extends TileEntity implements IFluidHandler, IFluidTankProperties, ICapabilityProvider, IFluidPipe
|
||||
{
|
||||
private static final BackFlowHandler back_flow_handler_ = new BackFlowHandler();
|
||||
protected static int fluid_maxflow_mb = 1000;
|
||||
protected static int redstone_flow_slope_mb = 1000/15;
|
||||
private final IFluidTankProperties[] fluid_props_ = {this};
|
||||
private EnumFacing block_facing_ = EnumFacing.NORTH;
|
||||
private boolean filling_ = false;
|
||||
private boolean getlocked_ = false;
|
||||
private boolean filling_enabled_ = true;
|
||||
private long block_config_ = 0;
|
||||
|
||||
public BTileEntity()
|
||||
{}
|
||||
|
||||
public void block_reconfigure(EnumFacing facing, long block_config)
|
||||
{
|
||||
block_facing_ = facing;
|
||||
block_config_ = block_config;
|
||||
filling_enabled_ = false;
|
||||
IFluidHandler fh = forward_fluid_handler();
|
||||
if(fh!=null) {
|
||||
if(fh.getTankProperties().length==0) {
|
||||
filling_enabled_ = true; // we don't know, so in doubt try filling.
|
||||
} else {
|
||||
for(IFluidTankProperties fp:fh.getTankProperties()) {
|
||||
if((fp!=null) && (fp.canFill())) { filling_enabled_ = true; break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TileEntity ------------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(World world, BlockPos pos, IBlockState os, IBlockState ns)
|
||||
{ return (os.getBlock() != ns.getBlock()) || (!(ns.getBlock() instanceof BlockDecorPipeValve)); }
|
||||
|
||||
@Override
|
||||
public void onLoad()
|
||||
{
|
||||
if(!hasWorld()) return;
|
||||
final IBlockState state = world.getBlockState(pos);
|
||||
if((!(state.getBlock() instanceof BlockDecorPipeValve))) return;
|
||||
block_reconfigure(state.getValue(FACING), block_config_);
|
||||
world.notifyNeighborsOfStateChange(pos, state.getBlock(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
int i = nbt.getInteger("facing");
|
||||
if((i>=0) || (i<6)) block_facing_ = EnumFacing.byIndex(i);
|
||||
block_config_ = nbt.getLong("conf");
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("facing", block_facing_.getIndex());
|
||||
nbt.setLong("conf", block_config_);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
// ICapabilityProvider --------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public boolean hasCapability(@Nonnull Capability<?> capability, @Nullable EnumFacing facing)
|
||||
{ return ((capability==CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) && ((facing==block_facing_) || (facing==block_facing_.getOpposite()))); }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Nullable
|
||||
public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing facing)
|
||||
{
|
||||
if(capability!=CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) return super.getCapability(capability, facing);
|
||||
return (facing==block_facing_) ? ((T)back_flow_handler_) : (((T)this));
|
||||
}
|
||||
|
||||
// IFluidHandler/IFluidTankProperties ---------------------------------------------------------------
|
||||
|
||||
@Nullable
|
||||
private IFluidHandler forward_fluid_handler()
|
||||
{
|
||||
final TileEntity te = world.getTileEntity(pos.offset(block_facing_));
|
||||
if(te == null) return null;
|
||||
return te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, block_facing_.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(FluidStack resource, boolean doFill)
|
||||
{
|
||||
if((filling_) || (!filling_enabled_)) return 0;
|
||||
if((block_config_ & CFG_REDSTONE_CONTROLLED) != 0) {
|
||||
int rs = world.getRedstonePowerFromNeighbors(pos);
|
||||
if(rs <= 0) return 0;
|
||||
if(((block_config_ & CFG_ANALOG) != 0) && (rs < 15)) resource.amount = MathHelper.clamp(rs * redstone_flow_slope_mb, 1, resource.amount);
|
||||
}
|
||||
FluidStack res = resource.copy();
|
||||
if(res.amount > fluid_maxflow_mb) res.amount = fluid_maxflow_mb;
|
||||
final IFluidHandler fh = forward_fluid_handler();
|
||||
if(fh==null) return 0;
|
||||
filling_ = true; // in case someone does not check the cap, but just "forwards back" what is beeing filled right now.
|
||||
if(res.amount > 50) {
|
||||
final TileEntity te = world.getTileEntity(pos.offset(block_facing_));
|
||||
if(te instanceof IFluidPipe) {
|
||||
// forward pressureized tag
|
||||
if(res.tag == null) res.tag = new NBTTagCompound();
|
||||
res.tag.setBoolean("pressurized", true);
|
||||
}
|
||||
}
|
||||
int n_filled = forward_fluid_handler().fill(res, doFill);
|
||||
filling_ = false;
|
||||
//if(n_filled > 0) System.out.println("F:" + resource.amount + "->" + n_filled);
|
||||
return n_filled;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public FluidStack drain(FluidStack resource, boolean doDrain)
|
||||
{ return null; }
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public FluidStack drain(int maxDrain, boolean doDrain)
|
||||
{ return null; }
|
||||
|
||||
@Override
|
||||
public IFluidTankProperties[] getTankProperties()
|
||||
{ return fluid_props_; }
|
||||
|
||||
// IFluidTankProperties --
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public FluidStack getContents()
|
||||
{ return null; }
|
||||
|
||||
public int getCapacity()
|
||||
{ return 1000; }
|
||||
|
||||
@Override
|
||||
public boolean canFill()
|
||||
{ return true; }
|
||||
|
||||
@Override
|
||||
public boolean canDrain()
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
public boolean canFillFluidType(FluidStack fluidStack)
|
||||
{ return true; }
|
||||
|
||||
@Override
|
||||
public boolean canDrainFluidType(FluidStack fluidStack)
|
||||
{ return false; }
|
||||
|
||||
// Back flow prevention handler --
|
||||
|
||||
private static class BackFlowHandler implements IFluidHandler, IFluidTankProperties
|
||||
{
|
||||
private final IFluidTankProperties[] props_ = {this};
|
||||
@Override public IFluidTankProperties[] getTankProperties() { return props_; }
|
||||
@Override public int fill(FluidStack resource, boolean doFill) { return 0; }
|
||||
@Override @Nullable public FluidStack drain(FluidStack resource, boolean doDrain) { return null; }
|
||||
@Override @Nullable public FluidStack drain(int maxDrain, boolean doDrain) { return null; }
|
||||
@Override @Nullable public FluidStack getContents() { return null; }
|
||||
@Override public int getCapacity() { return 0; }
|
||||
@Override public boolean canFill() { return false; }
|
||||
@Override public boolean canDrain() { return false; }
|
||||
@Override public boolean canFillFluidType(FluidStack fluidStack) { return false; }
|
||||
@Override public boolean canDrainFluidType(FluidStack fluidStack) { return false; }
|
||||
}
|
||||
|
||||
// IFluidPipe
|
||||
|
||||
@Override
|
||||
public boolean hasOutputConnection(EnumFacing side)
|
||||
{ return (side == block_facing_); }
|
||||
|
||||
@Override
|
||||
public boolean canOutputPressurized(boolean consumePower)
|
||||
{
|
||||
if(getlocked_ || (!filling_enabled_)) return false;
|
||||
final TileEntity te = world.getTileEntity(pos.offset(block_facing_));
|
||||
if(!(te instanceof IFluidPipe)) return false;
|
||||
getlocked_ = true; // not sure if IE explicitly pre-detects loops, so let's lock recurion here, too.
|
||||
boolean r = ((IFluidPipe)te).canOutputPressurized(consumePower);
|
||||
getlocked_ = false;
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -8,12 +8,26 @@
|
|||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import net.minecraft.block.material.EnumPushReaction;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.detail.ModAuxiliaries;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class BlockDecorStairs extends net.minecraft.block.BlockStairs
|
||||
public class BlockDecorStairs extends BlockStairs
|
||||
{
|
||||
public BlockDecorStairs(@Nonnull String registryName, IBlockState modelState)
|
||||
{
|
||||
|
@ -21,10 +35,40 @@ public class BlockDecorStairs extends net.minecraft.block.BlockStairs
|
|||
setCreativeTab(ModEngineersDecor.CREATIVE_TAB_ENGINEERSDECOR);
|
||||
setRegistryName(ModEngineersDecor.MODID, registryName);
|
||||
setTranslationKey(ModEngineersDecor.MODID + "." + registryName);
|
||||
setLightOpacity(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, @Nullable World world, List<String> tooltip, ITooltipFlag flag)
|
||||
{ ModAuxiliaries.Tooltip.addInformation(stack, world, tooltip, flag, true); }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isOpaqueCube(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isNormalCube(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
public boolean canSpawnInBlock()
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
public boolean canCreatureSpawn(IBlockState state, IBlockAccess world, BlockPos pos, net.minecraft.entity.EntityLiving.SpawnPlacementType type)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public EnumPushReaction getPushReaction(IBlockState state)
|
||||
{ return EnumPushReaction.NORMAL; }
|
||||
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.block.SoundType;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
|
@ -26,10 +27,9 @@ public class BlockDecorStraightPole extends BlockDecorDirected
|
|||
{ super(registryName, config, material, hardness, resistance, sound, unrotatedAABB); }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand)
|
||||
{
|
||||
IBlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer);
|
||||
IBlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand);
|
||||
if((config & CFG_FLIP_PLACEMENT_IF_SAME) != 0) {
|
||||
if(world.getBlockState(pos.offset(facing.getOpposite())).getBlock() instanceof BlockDecorStraightPole) {
|
||||
state = state.withProperty(FACING, state.getValue(FACING).getOpposite());
|
||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.block.*;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -41,6 +42,7 @@ public class BlockDecorWall extends BlockDecor
|
|||
public static final PropertyBool EAST = BlockWall.EAST;
|
||||
public static final PropertyBool SOUTH = BlockWall.SOUTH;
|
||||
public static final PropertyBool WEST = BlockWall.WEST;
|
||||
public static final PropertyInteger TEXTURE_VARIANT = PropertyInteger.create("tvariant", 0, 7);
|
||||
|
||||
private static final double d_0 = 0.0d;
|
||||
private static final double d_1 = 1.0d;
|
||||
|
@ -76,7 +78,6 @@ public class BlockDecorWall extends BlockDecor
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{ return AABB_BY_INDEX[getAABBIndex(getActualState(state, source, pos))]; }
|
||||
|
||||
|
@ -87,7 +88,6 @@ public class BlockDecorWall extends BlockDecor
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{ return CLIP_AABB_BY_INDEX[getAABBIndex(getActualState(state, world, pos))]; }
|
||||
|
||||
|
@ -99,22 +99,18 @@ public class BlockDecorWall extends BlockDecor
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isPassable(IBlockAccess world, BlockPos pos)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isOpaqueCube(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isNormalCube(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
|
@ -141,23 +137,19 @@ public class BlockDecorWall extends BlockDecor
|
|||
{ return Block.isExceptBlockForAttachWithPiston(b) || (b==Blocks.BARRIER) || (b==Blocks.MELON_BLOCK) || (b==Blocks.PUMPKIN) || (b==Blocks.LIT_PUMPKIN); }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
|
||||
{ return (side!=EnumFacing.DOWN) || (super.shouldSideBeRendered(blockState, blockAccess, pos, side)); }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{ return getDefaultState(); }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{ return 0; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
boolean n = canWallConnectTo(world, pos, EnumFacing.NORTH);
|
||||
|
@ -165,15 +157,15 @@ public class BlockDecorWall extends BlockDecor
|
|||
boolean s = canWallConnectTo(world, pos, EnumFacing.SOUTH);
|
||||
boolean w = canWallConnectTo(world, pos, EnumFacing.WEST);
|
||||
boolean nopole = (n && s && !e && !w) || (!n && !s && e && w);
|
||||
return state.withProperty(UP,!nopole).withProperty(NORTH, n).withProperty(EAST, e).withProperty(SOUTH, s).withProperty(WEST, w);
|
||||
long prnd = pos.toLong(); prnd = (prnd>>29) ^ (prnd>>17) ^ (prnd>>9) ^ (prnd>>4) ^ pos.getX() ^ pos.getY() ^ pos.getZ();
|
||||
return state.withProperty(UP,!nopole).withProperty(NORTH, n).withProperty(EAST, e).withProperty(SOUTH, s).withProperty(WEST, w).withProperty(TEXTURE_VARIANT, ((int)prnd) & 0x7);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{ return new BlockStateContainer(this, new IProperty[] {UP, NORTH, EAST, WEST, SOUTH}); }
|
||||
{ return new BlockStateContainer(this, new IProperty[] {UP, NORTH, EAST, WEST, SOUTH, TEXTURE_VARIANT}); }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing face)
|
||||
{ return (face==EnumFacing.UP) ? (BlockFaceShape.SOLID) : ((face!=EnumFacing.DOWN) ? (BlockFaceShape.MIDDLE_POLE_THICK) : (BlockFaceShape.CENTER_BIG)); }
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public class BlockDecorWindow extends BlockDecorDirected
|
|||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer)
|
||||
{ return (layer==BlockRenderLayer.CUTOUT) || (layer==BlockRenderLayer.TRANSLUCENT); }
|
||||
{ return (layer==BlockRenderLayer.CUTOUT_MIPPED) || (layer==BlockRenderLayer.TRANSLUCENT); }
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.detail.ModAuxiliaries;
|
||||
import wile.engineersdecor.detail.ModConfig;
|
||||
|
@ -35,49 +36,81 @@ import javax.annotation.Nonnull;
|
|||
@SuppressWarnings("unused")
|
||||
public class ModBlocks
|
||||
{
|
||||
public static final BlockDecorFull CLINKER_BRICK_BLOCK = new BlockDecorFull("clinker_brick_block", 0, Material.ROCK, 2f, 50f, SoundType.STONE);
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
//-- Blocks
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public static final BlockDecorFull CLINKER_BRICK_BLOCK = new BlockDecorFull("clinker_brick_block", 0, Material.ROCK, 2f, 15f, SoundType.STONE);
|
||||
public static final BlockDecorStairs CLINKER_BRICK_STAIRS = new BlockDecorStairs("clinker_brick_stairs", CLINKER_BRICK_BLOCK.getDefaultState());
|
||||
public static final BlockDecorWall CLINKER_BRICK_WALL = new BlockDecorWall("clinker_brick_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 50f, SoundType.STONE);
|
||||
public static final BlockDecorWall CLINKER_BRICK_WALL = new BlockDecorWall("clinker_brick_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 2f, 20f, SoundType.STONE);
|
||||
|
||||
public static final BlockDecorFull SLAG_BRICK_BLOCK = new BlockDecorFull("slag_brick_block", 0, Material.ROCK, 2f, 50f, SoundType.STONE);
|
||||
public static final BlockDecorFull SLAG_BRICK_BLOCK = new BlockDecorFull("slag_brick_block", 0, Material.ROCK, 2f, 15f, SoundType.STONE);
|
||||
public static final BlockDecorStairs SLAG_BRICK_STAIRS = new BlockDecorStairs("slag_brick_stairs", SLAG_BRICK_BLOCK.getDefaultState());
|
||||
public static final BlockDecorWall SLAG_BRICK_WALL = new BlockDecorWall("slag_brick_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 50f, SoundType.STONE);
|
||||
public static final BlockDecorWall SLAG_BRICK_WALL = new BlockDecorWall("slag_brick_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 2f, 15f, SoundType.STONE);
|
||||
|
||||
public static final BlockDecorFull REBAR_CONCRETE_BLOCK = new BlockDecorFull("rebar_concrete", 0, Material.ROCK, 8f, 2000f, SoundType.STONE);
|
||||
public static final BlockDecorFull REBAR_CONCRETE_BLOCK = new BlockDecorFull("rebar_concrete", 0, Material.ROCK, 5f, 2000f, SoundType.STONE);
|
||||
public static final BlockDecorStairs REBAR_CONCRETE_STAIRS = new BlockDecorStairs("rebar_concrete_stairs", REBAR_CONCRETE_BLOCK.getDefaultState());
|
||||
public static final BlockDecorWall REBAR_CONCRETE_WALL = new BlockDecorWall("rebar_concrete_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 2000f, SoundType.STONE);
|
||||
public static final BlockDecorFull REBAR_CONCRETE_TILE = new BlockDecorFull("rebar_concrete_tile", 0, Material.ROCK, 8f, 2000f, SoundType.STONE);
|
||||
public static final BlockDecorWall REBAR_CONCRETE_WALL = new BlockDecorWall("rebar_concrete_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 5f, 2000f, SoundType.STONE);
|
||||
public static final BlockDecorFull REBAR_CONCRETE_TILE = new BlockDecorFull("rebar_concrete_tile", 0, Material.ROCK, 5f, 2000f, SoundType.STONE);
|
||||
public static final BlockDecorStairs REBAR_CONCRETE_TILE_STAIRS = new BlockDecorStairs("rebar_concrete_tile_stairs", REBAR_CONCRETE_TILE.getDefaultState());
|
||||
|
||||
public static final BlockDecorWall CONCRETE_WALL = new BlockDecorWall("concrete_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 50f, SoundType.STONE);
|
||||
public static final BlockDecorWall CONCRETE_WALL = new BlockDecorWall("concrete_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 5f, 20f, SoundType.STONE);
|
||||
|
||||
public static final BlockDecorLadder METAL_RUNG_LADDER = new BlockDecorLadder("metal_rung_ladder", 0, Material.IRON, 1.0f, 25f, SoundType.METAL);
|
||||
public static final BlockDecorLadder METAL_RUNG_STEPS = new BlockDecorLadder("metal_rung_steps", 0, Material.IRON, 1.0f, 25f, SoundType.METAL);
|
||||
public static final BlockDecorLadder TREATED_WOOD_LADDER = new BlockDecorLadder("treated_wood_ladder", 0, Material.WOOD, 1.0f, 15f, SoundType.WOOD);
|
||||
public static final BlockDecorLadder METAL_RUNG_LADDER = new BlockDecorLadder("metal_rung_ladder", 0, Material.IRON, 1.0f, 20f, SoundType.METAL);
|
||||
public static final BlockDecorLadder METAL_RUNG_STEPS = new BlockDecorLadder("metal_rung_steps", 0, Material.IRON, 1.0f, 20f, SoundType.METAL);
|
||||
public static final BlockDecorLadder TREATED_WOOD_LADDER = new BlockDecorLadder("treated_wood_ladder", 0, Material.WOOD, 1.0f, 10f, SoundType.WOOD);
|
||||
|
||||
public static final BlockDecorGlassBlock PANZERGLASS_BLOCK = new BlockDecorGlassBlock("panzerglass_block", 0, Material.GLASS, 0.8f, 2000f, SoundType.GLASS);
|
||||
|
||||
public static final BlockDecorStraightPole TREATED_WOOD_POLE = new BlockDecorStraightPole(
|
||||
"treated_wood_pole",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_FACING_PLACEMENT,
|
||||
Material.WOOD, 1.0f, 15f, SoundType.WOOD,
|
||||
Material.WOOD, 1.0f, 10f, SoundType.WOOD,
|
||||
ModAuxiliaries.getPixeledAABB(5.8,5.8,0, 10.2,10.2,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorStraightPole TREATED_WOOD_POLE_HEAD = new BlockDecorStraightPole(
|
||||
"treated_wood_pole_head",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_FACING_PLACEMENT|BlockDecor.CFG_FLIP_PLACEMENT_IF_SAME,
|
||||
Material.WOOD, 1.0f, 15f, SoundType.WOOD,
|
||||
Material.WOOD, 1.0f, 10f, SoundType.WOOD,
|
||||
ModAuxiliaries.getPixeledAABB(5.8,5.8,0, 10.2,10.2,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorStraightPole TREATED_WOOD_POLE_SUPPORT = new BlockDecorStraightPole(
|
||||
"treated_wood_pole_support",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_FACING_PLACEMENT|BlockDecor.CFG_FLIP_PLACEMENT_IF_SAME,
|
||||
Material.WOOD, 1.0f, 15f, SoundType.WOOD,
|
||||
Material.WOOD, 1.0f, 10f, SoundType.WOOD,
|
||||
ModAuxiliaries.getPixeledAABB(5.8,5.8,0, 10.2,10.2,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorStraightPole THIN_STEEL_POLE = new BlockDecorStraightPole(
|
||||
"thin_steel_pole",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_FACING_PLACEMENT,
|
||||
Material.IRON, 1.0f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(6,6,0, 10,10,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorStraightPole THIN_STEEL_POLE_HEAD = new BlockDecorStraightPole(
|
||||
"thin_steel_pole_head",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_FACING_PLACEMENT|BlockDecor.CFG_FLIP_PLACEMENT_IF_SAME,
|
||||
Material.IRON, 1.0f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(6,6,0, 10,10,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorStraightPole THICK_STEEL_POLE = new BlockDecorStraightPole(
|
||||
"thick_steel_pole",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_FACING_PLACEMENT,
|
||||
Material.IRON, 1.0f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(5,5,0, 11,11,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorStraightPole THICK_STEEL_POLE_HEAD = new BlockDecorStraightPole(
|
||||
"thick_steel_pole_head",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_FACING_PLACEMENT|BlockDecor.CFG_FLIP_PLACEMENT_IF_SAME,
|
||||
Material.IRON, 1.0f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(5,5,0, 11,11,16)
|
||||
);
|
||||
|
||||
public static final BlockDecor TREATED_WOOD_TABLE = new BlockDecor(
|
||||
"treated_wood_table",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT,
|
||||
|
@ -94,7 +127,7 @@ public class ModBlocks
|
|||
|
||||
public static final BlockDecorCraftingTable TREATED_WOOD_CRAFTING_TABLE = new BlockDecorCraftingTable(
|
||||
"treated_wood_crafting_table",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT,
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT,
|
||||
Material.WOOD, 1.0f, 15f, SoundType.WOOD,
|
||||
ModAuxiliaries.getPixeledAABB(1,0,1, 15,15.9,15)
|
||||
);
|
||||
|
@ -109,40 +142,117 @@ public class ModBlocks
|
|||
public static final BlockDecorDirected TREATED_WOOD_WINDOWSILL = new BlockDecorDirected(
|
||||
"treated_wood_windowsill",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_FACING_PLACEMENT,
|
||||
Material.WOOD, 1.0f, 15f, SoundType.WOOD,
|
||||
Material.WOOD, 1.0f, 10f, SoundType.WOOD,
|
||||
ModAuxiliaries.getPixeledAABB(0.5,15,10.5, 15.5,16,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorWindow TREATED_WOOD_WINDOW = new BlockDecorWindow(
|
||||
"treated_wood_window",
|
||||
BlockDecor.CFG_TRANSLUCENT|BlockDecor.CFG_LOOK_PLACEMENT,
|
||||
Material.WOOD, 0.5f, 15f, SoundType.GLASS,
|
||||
Material.WOOD, 0.5f, 10f, SoundType.GLASS,
|
||||
ModAuxiliaries.getPixeledAABB(0,0,7, 16,16,9)
|
||||
);
|
||||
|
||||
public static final BlockDecorWindow STEEL_FRAMED_WINDOW = new BlockDecorWindow(
|
||||
"steel_framed_window",
|
||||
BlockDecor.CFG_TRANSLUCENT|BlockDecor.CFG_LOOK_PLACEMENT,
|
||||
Material.IRON, 0.5f, 30f, SoundType.GLASS,
|
||||
Material.IRON, 0.5f, 15f, SoundType.GLASS,
|
||||
ModAuxiliaries.getPixeledAABB(0,0,7.5, 16,16,8.5)
|
||||
);
|
||||
|
||||
public static final BlockDecorFurnace SMALL_LAB_FURNACE = new BlockDecorFurnace(
|
||||
"small_lab_furnace",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT,
|
||||
Material.IRON, 0.35f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(1,0,1, 15,15,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorFurnaceElectrical SMALL_ELECTRICAL_FURNACE = new BlockDecorFurnaceElectrical(
|
||||
"small_electrical_furnace",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT,
|
||||
Material.IRON, 1.0f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(1,0,1, 15,15,16.0)
|
||||
Material.IRON, 0.35f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(0,0,0, 16,16,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorDirected SIGN_MODLOGO = new BlockDecorDirected(
|
||||
"sign_decor",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_OPPOSITE_PLACEMENT|(1<<BlockDecor.CFG_LIGHT_VALUE_SHIFT),
|
||||
Material.WOOD, 0.1f, 1000f, SoundType.WOOD,
|
||||
ModAuxiliaries.getPixeledAABB(0,0,15.6, 16,16,16.0)
|
||||
ModAuxiliaries.getPixeledAABB(0,0,15.6, 16,16,16)
|
||||
);
|
||||
|
||||
private static final Block modBlocks[] = {
|
||||
TREATED_WOOD_CRAFTING_TABLE,
|
||||
public static final BlockDecorHorizontalSupport STEEL_DOUBLE_T_SUPPORT = new BlockDecorHorizontalSupport(
|
||||
"steel_double_t_support",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT,
|
||||
Material.IRON, 0.5f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(5,11,0, 11,16,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorPipeValve STRAIGHT_CHECK_VALVE = new BlockDecorPipeValve(
|
||||
"straight_pipe_valve",
|
||||
BlockDecor.CFG_FACING_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT|BlockDecor.CFG_FLIP_PLACEMENT_SHIFTCLICK|
|
||||
BlockDecor.CFG_CUTOUT,
|
||||
Material.IRON, 0.35f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(4,4,0, 12,12,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorPipeValve STRAIGHT_REDSTONE_VALVE = new BlockDecorPipeValve(
|
||||
"straight_pipe_valve_redstone",
|
||||
BlockDecor.CFG_FACING_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT|BlockDecor.CFG_FLIP_PLACEMENT_SHIFTCLICK|
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_REDSTONE_CONTROLLED,
|
||||
Material.IRON, 0.35f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(4,4,0, 12,12,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorPipeValve STRAIGHT_REDSTONE_ANALOG_VALVE = new BlockDecorPipeValve(
|
||||
"straight_pipe_valve_redstone_analog",
|
||||
BlockDecor.CFG_FACING_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT|BlockDecor.CFG_FLIP_PLACEMENT_SHIFTCLICK|
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_REDSTONE_CONTROLLED|BlockDecor.CFG_ANALOG,
|
||||
Material.IRON, 0.35f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(4,4,0, 12,12,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorPassiveFluidAccumulator PASSIVE_FLUID_ACCUMULATOR = new BlockDecorPassiveFluidAccumulator(
|
||||
"passive_fluid_accumulator",
|
||||
BlockDecor.CFG_FACING_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT|BlockDecor.CFG_FLIP_PLACEMENT_SHIFTCLICK|
|
||||
BlockDecor.CFG_CUTOUT,
|
||||
Material.IRON, 0.35f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(0,0,0, 16,16,16)
|
||||
);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
//-- Tile entities
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
private static class TileEntityRegistrationData
|
||||
{
|
||||
public final Class<? extends TileEntity> clazz;
|
||||
public final ResourceLocation key;
|
||||
public TileEntityRegistrationData(Class<? extends TileEntity> c, String k) { clazz=c; key = new ResourceLocation(ModEngineersDecor.MODID, k); }
|
||||
}
|
||||
|
||||
private static final TileEntityRegistrationData TREATED_WOOD_CRAFTING_TABLE_TEI = new TileEntityRegistrationData(
|
||||
BlockDecorCraftingTable.BTileEntity.class, "te_crafting_table"
|
||||
);
|
||||
private static final TileEntityRegistrationData SMALL_LAB_FURNACE_TEI = new TileEntityRegistrationData(
|
||||
BlockDecorFurnace.BTileEntity.class, "te_small_lab_furnace"
|
||||
);
|
||||
private static final TileEntityRegistrationData SMALL_ELECTRICAL_FURNACE_TEI = new TileEntityRegistrationData(
|
||||
BlockDecorFurnaceElectrical.BTileEntity.class, "te_electrical_lab_furnace"
|
||||
);
|
||||
private static final TileEntityRegistrationData STRAIGHT_PIPE_VALVE_TEI = new TileEntityRegistrationData(
|
||||
BlockDecorPipeValve.BTileEntity.class, "te_pipe_valve"
|
||||
);
|
||||
private static final TileEntityRegistrationData PASSIVE_FLUID_ACCUMULATOR_TEI = new TileEntityRegistrationData(
|
||||
BlockDecorPassiveFluidAccumulator.BTileEntity.class, "te_passive_fluid_accumulator"
|
||||
);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
//-- Registration list
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
private static final Object content[] = {
|
||||
TREATED_WOOD_CRAFTING_TABLE, TREATED_WOOD_CRAFTING_TABLE_TEI,
|
||||
CLINKER_BRICK_BLOCK,
|
||||
CLINKER_BRICK_STAIRS,
|
||||
CLINKER_BRICK_WALL,
|
||||
|
@ -165,17 +275,30 @@ public class ModBlocks
|
|||
TREATED_WOOD_WINDOW,
|
||||
TREATED_WOOD_WINDOWSILL,
|
||||
INSET_LIGHT_IRON,
|
||||
SMALL_LAB_FURNACE,
|
||||
SMALL_LAB_FURNACE, SMALL_LAB_FURNACE_TEI,
|
||||
STEEL_FRAMED_WINDOW,
|
||||
TREATED_WOOD_POLE_SUPPORT,
|
||||
TREATED_WOOD_POLE_HEAD,
|
||||
SIGN_MODLOGO
|
||||
SIGN_MODLOGO,
|
||||
THIN_STEEL_POLE,
|
||||
THICK_STEEL_POLE,
|
||||
THIN_STEEL_POLE_HEAD,
|
||||
THICK_STEEL_POLE_HEAD,
|
||||
STEEL_DOUBLE_T_SUPPORT,
|
||||
STRAIGHT_CHECK_VALVE, STRAIGHT_REDSTONE_VALVE, STRAIGHT_REDSTONE_ANALOG_VALVE, STRAIGHT_PIPE_VALVE_TEI
|
||||
};
|
||||
|
||||
private static final Block devBlocks[] = {
|
||||
private static final Object dev_content[] = {
|
||||
PASSIVE_FLUID_ACCUMULATOR, PASSIVE_FLUID_ACCUMULATOR_TEI,
|
||||
SMALL_ELECTRICAL_FURNACE, SMALL_ELECTRICAL_FURNACE_TEI
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
//-- Init
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
private static ArrayList<Block> registeredBlocks = new ArrayList<>();
|
||||
private static ArrayList<TileEntityRegistrationData> registeredTileEntityInits = new ArrayList<>();
|
||||
|
||||
@Nonnull
|
||||
public static List<Block> getRegisteredBlocks()
|
||||
|
@ -185,28 +308,33 @@ public class ModBlocks
|
|||
public static final void registerBlocks(RegistryEvent.Register<Block> event)
|
||||
{
|
||||
// Config based registry selection
|
||||
int num_registrations_skipped = 0;
|
||||
ArrayList<Block> allBlocks = new ArrayList<>();
|
||||
Collections.addAll(allBlocks, modBlocks);
|
||||
//if(Loader.isModLoaded("immersiveengineering")){}
|
||||
if(ModConfig.zmisc.with_experimental) Collections.addAll(allBlocks, devBlocks);
|
||||
int num_block_registrations_skipped = 0;
|
||||
final boolean woor = ModConfig.isWithoutOptOutRegistration();
|
||||
for(Block e:allBlocks) {
|
||||
if((!woor) || (!ModConfig.isOptedOut(e))) {
|
||||
registeredBlocks.add(e);
|
||||
} else {
|
||||
++num_registrations_skipped;
|
||||
for(Object e:content) {
|
||||
if(e instanceof Block) {
|
||||
if((!woor) || (!ModConfig.isOptedOut((Block)e))) {
|
||||
registeredBlocks.add((Block) e);
|
||||
} else {
|
||||
++num_block_registrations_skipped;
|
||||
}
|
||||
} else if(e instanceof TileEntityRegistrationData) {
|
||||
registeredTileEntityInits.add((TileEntityRegistrationData)e);
|
||||
}
|
||||
}
|
||||
if(ModConfig.zmisc.with_experimental) {
|
||||
for(Object e:dev_content) {
|
||||
if(e instanceof Block) {
|
||||
registeredBlocks.add((Block) e);
|
||||
} else if(e instanceof TileEntityRegistrationData) {
|
||||
registeredTileEntityInits.add((TileEntityRegistrationData) e);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(Block e:registeredBlocks) event.getRegistry().register(e);
|
||||
ModEngineersDecor.logger.info("Registered " + Integer.toString(registeredBlocks.size()) + " blocks.");
|
||||
if(num_registrations_skipped > 0) {
|
||||
ModEngineersDecor.logger.info("Skipped registration of " + num_registrations_skipped + " blocks due to no-register-opt-out config.");
|
||||
}
|
||||
|
||||
// TEs
|
||||
GameRegistry.registerTileEntity(BlockDecorCraftingTable.BTileEntity.class, new ResourceLocation(ModEngineersDecor.MODID, "te_crafting_table"));
|
||||
GameRegistry.registerTileEntity(BlockDecorFurnace.BTileEntity.class, new ResourceLocation(ModEngineersDecor.MODID, "te_small_lab_furnace"));
|
||||
if(num_block_registrations_skipped > 0) ModEngineersDecor.logger.info("Skipped registration of " + num_block_registrations_skipped + " blocks.");
|
||||
for(TileEntityRegistrationData e:registeredTileEntityInits) GameRegistry.registerTileEntity(e.clazz, e.key);
|
||||
ModEngineersDecor.logger.info("Registered " + Integer.toString(registeredTileEntityInits.size()) + " tile entities.");
|
||||
}
|
||||
|
||||
// Invoked from ClientProxy.registerModels()
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
package wile.engineersdecor.detail;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -144,4 +145,14 @@ public class ModAuxiliaries
|
|||
}
|
||||
return bb;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void playerChatMessage(EntityPlayer player, final String message)
|
||||
{
|
||||
String s = message.trim();
|
||||
if(!s.isEmpty()) player.sendMessage(new TextComponentTranslation(s));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public interface IExperimentalFeature{}
|
||||
}
|
||||
|
|
|
@ -14,11 +14,11 @@ import wile.engineersdecor.blocks.*;
|
|||
import net.minecraftforge.common.config.Config;
|
||||
import net.minecraftforge.common.config.ConfigManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@Config(modid = ModEngineersDecor.MODID)
|
||||
|
@ -107,6 +107,9 @@ public class ModConfig
|
|||
@Config.Name("Without ladder speed boost")
|
||||
public boolean without_ladder_speed_boost = false;
|
||||
|
||||
@Config.Comment({"Disable history refabrication feature of the treated wood crafting table."})
|
||||
@Config.Name("Without crafting table history")
|
||||
public boolean without_crafting_table_history = false;
|
||||
}
|
||||
|
||||
@Config.Comment({
|
||||
|
@ -192,6 +195,51 @@ public class ModConfig
|
|||
@Config.Name("Chairs: Stand up chance %")
|
||||
@Config.RangeDouble(min=0.001, max=10)
|
||||
public double chair_mob_standup_probability_percent = 1;
|
||||
|
||||
@Config.Comment({"Enables small quick-move arrows from/to player/block storage. " +
|
||||
"Makes the UI a bit too busy, therefore disabled by default."
|
||||
})
|
||||
@Config.Name("Crafting table: Move buttons")
|
||||
public boolean with_crafting_quickmove_buttons = false;
|
||||
|
||||
@Config.Comment({
|
||||
"Defines how many millibuckets can be transferred (per tick) through the valves. " +
|
||||
"That is technically the 'storage size' specified for blocks that want to fill " +
|
||||
"fluids into the valve (the valve has no container and forward that to the output " +
|
||||
"block), The value can be changed on-the-fly for tuning. "
|
||||
})
|
||||
@Config.Name("Valves: Max flow rate")
|
||||
@Config.RangeInt(min=1, max=10000)
|
||||
public int pipevalve_max_flowrate = 1000;
|
||||
|
||||
@Config.Comment({
|
||||
"Defines how many millibuckets per redstone signal strength can be transferred per tick " +
|
||||
"through the analog redstone controlled valves. Note: power 0 is always off, power 15 is always " +
|
||||
"the max flow rate. Between power 1 and 14 this scaler will result in a flow = 'redstone slope' * 'current redstone power'. " +
|
||||
"The value can be changed on-the-fly for tuning. "
|
||||
})
|
||||
@Config.Name("Valves: Redstone slope")
|
||||
@Config.RangeInt(min=1, max=10000)
|
||||
public int pipevalve_redstone_slope = 20;
|
||||
|
||||
@Config.Comment({
|
||||
"Defines, in percent, how fast the electrical furnace smelts compared to " +
|
||||
"a vanilla furnace. 100% means vanilla furnace speed, 150% means the " +
|
||||
"electrical furnace is faster. The value can be changed on-the-fly for tuning."
|
||||
})
|
||||
@Config.Name("E-furnace: Smelting speed %")
|
||||
@Config.RangeInt(min=50, max=500)
|
||||
public int e_furnace_speed_percent = BlockDecorFurnaceElectrical.BTileEntity.DEFAULT_SPEED_PERCENT;
|
||||
|
||||
@Config.Comment({
|
||||
"Defines how much RF per tick the the electrical furnace consumed (average) for smelting. " +
|
||||
"The feeders transferring items from/to adjacent have this consumption/8 for each stack transaction. " +
|
||||
"The default value is only slightly higher than a furnace with an IE external heater (and no burning fuel inside)." +
|
||||
"The config value can be changed on-the-fly for tuning."
|
||||
})
|
||||
@Config.Name("E-furnace: Power consumption")
|
||||
@Config.RangeInt(min=10, max=256)
|
||||
public int e_furnace_power_consumption = BlockDecorFurnaceElectrical.BTileEntity.DEFAULT_ENERGY_CONSUMPTION;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
@ -220,6 +268,7 @@ public class ModConfig
|
|||
{
|
||||
if((block == null) || (optout==null)) return true;
|
||||
if(block == ModBlocks.SIGN_MODLOGO) return true;
|
||||
if((!zmisc.with_experimental) && (block instanceof ModAuxiliaries.IExperimentalFeature)) return true;
|
||||
final String rn = block.getRegistryName().getPath();
|
||||
if(optout.without_clinker_bricks && rn.startsWith("clinker_brick_")) return true;
|
||||
if(optout.without_slag_bricks && rn.startsWith("slag_brick_")) return true;
|
||||
|
@ -244,6 +293,12 @@ public class ModConfig
|
|||
return false;
|
||||
}
|
||||
|
||||
public static final boolean isOptedOut(final @Nullable Item item)
|
||||
{
|
||||
if((item == null) || (optout == null)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static final void apply()
|
||||
{
|
||||
BlockDecorFurnace.BTileEntity.on_config(tweaks.furnace_smelting_speed_percent, tweaks.furnace_fuel_efficiency_percent, tweaks.furnace_boost_energy_consumption);
|
||||
|
@ -251,7 +306,9 @@ public class ModConfig
|
|||
if(tweaks.furnace_smelts_nuggets) ModRecipes.furnaceRecipeOverrideSmeltsOresToNuggets();
|
||||
BlockDecorChair.on_config(optout.without_chair_sitting, optout.without_mob_chair_sitting, tweaks.chair_mob_sitting_probability_percent, tweaks.chair_mob_standup_probability_percent);
|
||||
BlockDecorLadder.on_config(optout.without_ladder_speed_boost);
|
||||
BlockDecorCraftingTable.on_config(!zmisc.with_experimental);
|
||||
BlockDecorCraftingTable.on_config(optout.without_crafting_table_history, false, tweaks.with_crafting_quickmove_buttons);
|
||||
BlockDecorPipeValve.on_config(tweaks.pipevalve_max_flowrate, tweaks.pipevalve_redstone_slope);
|
||||
BlockDecorFurnaceElectrical.BTileEntity.on_config(tweaks.e_furnace_speed_percent, tweaks.e_furnace_power_consumption);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,23 +5,43 @@
|
|||
* @license MIT (see https://opensource.org/licenses/MIT)
|
||||
*
|
||||
* General handling auxiliaries for mod recipes.
|
||||
*
|
||||
* Credits/references:
|
||||
*
|
||||
* - Looked up how blusunrise did the ore-to-grit recipes in `blusunrize.immersiveengineering.common.IERecipes`.
|
||||
*/
|
||||
package wile.engineersdecor.detail;
|
||||
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.blocks.BlockDecorFurnace;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
||||
public class ModRecipes
|
||||
{
|
||||
public static final void registerRecipes(RegistryEvent.Register<IRecipe> event)
|
||||
{}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// Furnace
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Not a standard recipe, on-the-fly changable behaviour of the furnace.
|
||||
*/
|
||||
public static final void furnaceRecipeOverrideReset()
|
||||
{ BlockDecorFurnace.BRecipes.instance().reset(); }
|
||||
|
||||
/**
|
||||
* Not a standard recipe, on-the-fly changable behaviour of the furnace.
|
||||
*/
|
||||
public static final void furnaceRecipeOverrideSmeltsOresToNuggets()
|
||||
{
|
||||
try {
|
||||
|
|
|
@ -8,12 +8,13 @@
|
|||
*/
|
||||
package wile.engineersdecor.eapi.jei;
|
||||
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.blocks.BlockDecorCraftingTable;
|
||||
import wile.engineersdecor.blocks.ModBlocks;
|
||||
import wile.engineersdecor.detail.ModConfig;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.blocks.ModBlocks;
|
||||
import wile.engineersdecor.detail.ModConfig;
|
||||
|
||||
@mezz.jei.api.JEIPlugin
|
||||
public class JEIPlugin implements mezz.jei.api.IModPlugin
|
||||
|
@ -22,6 +23,7 @@ public class JEIPlugin implements mezz.jei.api.IModPlugin
|
|||
@SuppressWarnings("deprecation")
|
||||
public void register(mezz.jei.api.IModRegistry registry)
|
||||
{
|
||||
// Block/item hiding
|
||||
try {
|
||||
for(Block e:ModBlocks.getRegisteredBlocks()) {
|
||||
if(ModConfig.isOptedOut(e)) {
|
||||
|
@ -37,7 +39,20 @@ public class JEIPlugin implements mezz.jei.api.IModPlugin
|
|||
}
|
||||
}
|
||||
} catch(Throwable e) {
|
||||
ModEngineersDecor.logger.warn("Exception in JEI opt-out processing: '" + e.getMessage() + "', skipping further JEI processing.");
|
||||
ModEngineersDecor.logger.warn("Exception in JEI opt-out processing: '" + e.getMessage() + "', skipping further JEI optout processing.");
|
||||
}
|
||||
// Crafting table registration
|
||||
if(!ModConfig.optout.without_crafting_table) {
|
||||
try {
|
||||
mezz.jei.api.recipe.transfer.IRecipeTransferRegistry recipeTranferRegistry = registry.getRecipeTransferRegistry();
|
||||
recipeTranferRegistry.addRecipeTransferHandler(
|
||||
BlockDecorCraftingTable.BContainer.class,
|
||||
mezz.jei.api.recipe.VanillaRecipeCategoryUid.CRAFTING,
|
||||
1, 9, 10, 44
|
||||
);
|
||||
} catch(Throwable e) {
|
||||
ModEngineersDecor.logger.warn("Exception in JEI crafting table handler registration: '" + e.getMessage() + "'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
51
1.12/src/main/java/wile/engineersdecor/items/ItemDecor.java
Normal file
51
1.12/src/main/java/wile/engineersdecor/items/ItemDecor.java
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* @file ItemDecor.java
|
||||
* @author Stefan Wilhelm (wile)
|
||||
* @copyright (C) 2018 Stefan Wilhelm
|
||||
* @license MIT (see https://opensource.org/licenses/MIT)
|
||||
*
|
||||
* Basic item functionality for mod items.
|
||||
*/
|
||||
package wile.engineersdecor.items;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.detail.ModAuxiliaries;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemDecor extends Item
|
||||
{
|
||||
ItemDecor(String registryName)
|
||||
{
|
||||
super();
|
||||
setRegistryName(ModEngineersDecor.MODID, registryName);
|
||||
setTranslationKey(ModEngineersDecor.MODID + "." + registryName);
|
||||
setMaxStackSize(64);
|
||||
setCreativeTab(ModEngineersDecor.CREATIVE_TAB_ENGINEERSDECOR);
|
||||
setHasSubtypes(false);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void initModel()
|
||||
{
|
||||
ModelResourceLocation rc = new ModelResourceLocation(getRegistryName(),"inventory");
|
||||
ModelBakery.registerItemVariants(this, rc);
|
||||
ModelLoader.setCustomMeshDefinition(this, stack->rc);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, @Nullable World world, List<String> tooltip, ITooltipFlag flag)
|
||||
{ ModAuxiliaries.Tooltip.addInformation(stack, world, tooltip, flag, true); }
|
||||
|
||||
}
|
63
1.12/src/main/java/wile/engineersdecor/items/ModItems.java
Normal file
63
1.12/src/main/java/wile/engineersdecor/items/ModItems.java
Normal file
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* @file ModItems.java
|
||||
* @author Stefan Wilhelm (wile)
|
||||
* @copyright (C) 2018 Stefan Wilhelm
|
||||
* @license MIT (see https://opensource.org/licenses/MIT)
|
||||
*
|
||||
* Definition and initialisation of items of this module.
|
||||
*/
|
||||
package wile.engineersdecor.items;
|
||||
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.detail.ModConfig;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ModItems
|
||||
{
|
||||
|
||||
private static final Item[] modItems = {
|
||||
};
|
||||
|
||||
private static final ArrayList<Item> registeredItems = new ArrayList<>();
|
||||
|
||||
@Nonnull
|
||||
public static List<Item> getRegisteredItems()
|
||||
{ return Collections.unmodifiableList(registeredItems); }
|
||||
|
||||
public static final void registerItems(RegistryEvent.Register<Item> event)
|
||||
{
|
||||
// Config based registry selection
|
||||
int num_registrations_skipped = 0;
|
||||
ArrayList<Item> allItems = new ArrayList<>();
|
||||
Collections.addAll(allItems, modItems);
|
||||
final boolean woor = ModConfig.isWithoutOptOutRegistration();
|
||||
for(Item e:allItems) {
|
||||
if((!woor) || (!ModConfig.isOptedOut(e))) {
|
||||
registeredItems.add(e);
|
||||
} else {
|
||||
++num_registrations_skipped;
|
||||
}
|
||||
}
|
||||
for(Item e:registeredItems) event.getRegistry().register(e);
|
||||
ModEngineersDecor.logger.info("Registered " + Integer.toString(registeredItems.size()) + " items.");
|
||||
if(num_registrations_skipped > 0) {
|
||||
ModEngineersDecor.logger.info("Skipped registration of " + num_registrations_skipped + " items.");
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static final void initModels()
|
||||
{
|
||||
for(Item e:registeredItems) {
|
||||
if(e instanceof ItemDecor) ((ItemDecor)e).initModel();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:decor_full_block_model",
|
||||
"model": "engineersdecor:std/decor_full_block_model",
|
||||
"textures": { "all": "engineersdecor:blocks/clinker_brick/clinker_brick_texture0" }
|
||||
},
|
||||
"variants": {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"defaults": {
|
||||
"model": "engineersdecor:wall/clinker_brick_wall_default",
|
||||
"textures": {
|
||||
"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall",
|
||||
"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall0",
|
||||
"postside": "engineersdecor:blocks/clinker_brick/clinker_brick_pole_side",
|
||||
"top": "engineersdecor:blocks/clinker_brick/clinker_brick_top",
|
||||
"particle": "engineersdecor:blocks/clinker_brick/clinker_brick_top"
|
||||
|
@ -15,6 +15,16 @@
|
|||
"north": { "false":{}, "true": {"submodel": {"clinker_wall_north" : {"model": "engineersdecor:wall/clinker_brick_wall_side", "uvlock": true, "y": 0 }}} },
|
||||
"east" : { "false":{}, "true": {"submodel": {"clinker_wall_east" : {"model": "engineersdecor:wall/clinker_brick_wall_side", "uvlock": true, "y": 90 }}} },
|
||||
"south": { "false":{}, "true": {"submodel": {"clinker_wall_south" : {"model": "engineersdecor:wall/clinker_brick_wall_side", "uvlock": true, "y": 180 }}} },
|
||||
"west" : { "false":{}, "true": {"submodel": {"clinker_wall_west" : {"model": "engineersdecor:wall/clinker_brick_wall_side", "uvlock": true, "y": 270 }}} }
|
||||
"west" : { "false":{}, "true": {"submodel": {"clinker_wall_west" : {"model": "engineersdecor:wall/clinker_brick_wall_side", "uvlock": true, "y": 270 }}} },
|
||||
"tvariant": {
|
||||
"0":{"textures":{"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall0"}},
|
||||
"1":{"textures":{"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall1"}},
|
||||
"2":{"textures":{"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall2"}},
|
||||
"3":{"textures":{"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall3"}},
|
||||
"4":{"textures":{"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall4"}},
|
||||
"5":{"textures":{"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall5"}},
|
||||
"6":{"textures":{"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall6"}},
|
||||
"7":{"textures":{"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall7"}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
"north": { "false":{}, "true": {"submodel": {"concrete_wall_north" : {"model": "engineersdecor:wall/concrete_wall_side", "uvlock": true, "y": 0 }}} },
|
||||
"east" : { "false":{}, "true": {"submodel": {"concrete_wall_east" : {"model": "engineersdecor:wall/concrete_wall_side", "uvlock": true, "y": 90 }}} },
|
||||
"south": { "false":{}, "true": {"submodel": {"concrete_wall_south" : {"model": "engineersdecor:wall/concrete_wall_side", "uvlock": true, "y": 180 }}} },
|
||||
"west" : { "false":{}, "true": {"submodel": {"concrete_wall_west" : {"model": "engineersdecor:wall/concrete_wall_side", "uvlock": true, "y": 270 }}} }
|
||||
"west" : { "false":{}, "true": {"submodel": {"concrete_wall_west" : {"model": "engineersdecor:wall/concrete_wall_side", "uvlock": true, "y": 270 }}} },
|
||||
"tvariant": { "0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{} }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:pipe/passive_fluid_accumulator_model"
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"inventory": [{}],
|
||||
"facing": { "north":{"y":0}, "south":{"y":180}, "west":{"y":270}, "east":{"y":90}, "up": {"x":-90}, "down": {"x":90} }
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:decor_full_block_model",
|
||||
"model": "engineersdecor:std/decor_full_block_model",
|
||||
"textures": { "all": "engineersdecor:blocks/concrete/rebar_concrete_texture0" }
|
||||
},
|
||||
"variants": {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:decor_full_block_model",
|
||||
"model": "engineersdecor:std/decor_full_block_model",
|
||||
"textures": { "all": "engineersdecor:blocks/concrete/rebar_concrete_tile_texture0" }
|
||||
},
|
||||
"variants": {
|
||||
|
|
|
@ -13,6 +13,16 @@
|
|||
"north": { "false":{}, "true": {"submodel": {"concrete_wall_north" : {"model": "engineersdecor:wall/concrete_wall_side", "uvlock": true, "y": 0 }}} },
|
||||
"east" : { "false":{}, "true": {"submodel": {"concrete_wall_east" : {"model": "engineersdecor:wall/concrete_wall_side", "uvlock": true, "y": 90 }}} },
|
||||
"south": { "false":{}, "true": {"submodel": {"concrete_wall_south" : {"model": "engineersdecor:wall/concrete_wall_side", "uvlock": true, "y": 180 }}} },
|
||||
"west" : { "false":{}, "true": {"submodel": {"concrete_wall_west" : {"model": "engineersdecor:wall/concrete_wall_side", "uvlock": true, "y": 270 }}} }
|
||||
"west" : { "false":{}, "true": {"submodel": {"concrete_wall_west" : {"model": "engineersdecor:wall/concrete_wall_side", "uvlock": true, "y": 270 }}} },
|
||||
"tvariant": {
|
||||
"0":{"textures":{ "wall": "engineersdecor:blocks/concrete/rebar_concrete_texture0" }},
|
||||
"1":{"textures":{ "wall": "engineersdecor:blocks/concrete/rebar_concrete_texture1" }},
|
||||
"2":{"textures":{ "wall": "engineersdecor:blocks/concrete/rebar_concrete_texture2" }},
|
||||
"3":{"textures":{ "wall": "engineersdecor:blocks/concrete/rebar_concrete_texture3" }},
|
||||
"4":{"textures":{ "wall": "engineersdecor:blocks/concrete/rebar_concrete_texture4" }},
|
||||
"5":{"textures":{ "wall": "engineersdecor:blocks/concrete/rebar_concrete_texture5" }},
|
||||
"6":{"textures":{ "wall": "engineersdecor:blocks/concrete/rebar_concrete_texture6" }},
|
||||
"7":{"textures":{ "wall": "engineersdecor:blocks/concrete/rebar_concrete_texture7" }}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:decor_full_block_model",
|
||||
"model": "engineersdecor:std/decor_full_block_model",
|
||||
"textures": { "all": "engineersdecor:blocks/slag_brick/slag_brick_texture0" }
|
||||
},
|
||||
"variants": {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"defaults": {
|
||||
"model": "engineersdecor:wall/slag_brick_wall_default",
|
||||
"textures": {
|
||||
"wall": "engineersdecor:blocks/slag_brick/slag_brick_wall",
|
||||
"wall": "engineersdecor:blocks/slag_brick/slag_brick_wall0",
|
||||
"postside": "engineersdecor:blocks/slag_brick/slag_brick_pole_side",
|
||||
"top": "engineersdecor:blocks/slag_brick/slag_brick_top",
|
||||
"particle": "engineersdecor:blocks/slag_brick/slag_brick_top"
|
||||
|
@ -15,6 +15,16 @@
|
|||
"north": { "false":{}, "true": {"submodel": {"clinker_wall_north" : {"model": "engineersdecor:wall/slag_brick_wall_side", "uvlock": true, "y": 0 }}} },
|
||||
"east" : { "false":{}, "true": {"submodel": {"clinker_wall_east" : {"model": "engineersdecor:wall/slag_brick_wall_side", "uvlock": true, "y": 90 }}} },
|
||||
"south": { "false":{}, "true": {"submodel": {"clinker_wall_south" : {"model": "engineersdecor:wall/slag_brick_wall_side", "uvlock": true, "y": 180 }}} },
|
||||
"west" : { "false":{}, "true": {"submodel": {"clinker_wall_west" : {"model": "engineersdecor:wall/slag_brick_wall_side", "uvlock": true, "y": 270 }}} }
|
||||
"west" : { "false":{}, "true": {"submodel": {"clinker_wall_west" : {"model": "engineersdecor:wall/slag_brick_wall_side", "uvlock": true, "y": 270 }}} },
|
||||
"tvariant": {
|
||||
"0":{"textures":{ "wall": "engineersdecor:blocks/slag_brick/slag_brick_wall0" }},
|
||||
"1":{"textures":{ "wall": "engineersdecor:blocks/slag_brick/slag_brick_wall1" }},
|
||||
"2":{"textures":{ "wall": "engineersdecor:blocks/slag_brick/slag_brick_wall2" }},
|
||||
"3":{"textures":{ "wall": "engineersdecor:blocks/slag_brick/slag_brick_wall3" }},
|
||||
"4":{"textures":{ "wall": "engineersdecor:blocks/slag_brick/slag_brick_wall4" }},
|
||||
"5":{"textures":{ "wall": "engineersdecor:blocks/slag_brick/slag_brick_wall5" }},
|
||||
"6":{"textures":{ "wall": "engineersdecor:blocks/slag_brick/slag_brick_wall6" }},
|
||||
"7":{"textures":{ "wall": "engineersdecor:blocks/slag_brick/slag_brick_wall7" }}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:furnace/small_electrical_furnace_model"
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"inventory": [{}],
|
||||
"facing": { "north": {"y":0}, "south": {"y":180}, "west": {"y":-90}, "east": {"y":90}, "up":{}, "down":{} },
|
||||
"lit": { "false":{ "textures":{ "gloom": "engineersdecor:blocks/furnace/small_electrical_furnace_gloom_off" } }, "true":{}}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:hsupport/steel_double_t_support_model",
|
||||
"textures": {
|
||||
"particle": "engineersdecor:blocks/hsupport/steel_double_t_support_side_texture",
|
||||
"side": "engineersdecor:blocks/hsupport/steel_double_t_support_side_texture",
|
||||
"top": "engineersdecor:blocks/hsupport/steel_double_t_support_top_texture",
|
||||
"end": "engineersdecor:blocks/hsupport/steel_double_t_support_end_texture"
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"inventory": [{}],
|
||||
"eastwest": { "false":{"y":0}, "true": {"y":90}},
|
||||
"rightbeam": { "false":{}, "true": {
|
||||
"submodel": {"rsteelsupport": { "model": "engineersdecor:hsupport/steel_double_t_support_xconnect_model", "y": 0 }}
|
||||
}},
|
||||
"leftbeam": { "false":{}, "true": {
|
||||
"submodel": {"lsteelsupport": { "model": "engineersdecor:hsupport/steel_double_t_support_xconnect_model", "y": 180 }}
|
||||
}},
|
||||
"downconnect": {
|
||||
"0": {},
|
||||
"1": { "submodel": {"dthinpole": { "model": "engineersdecor:hsupport/steel_double_t_support_xconnect_thin_pole_model"}} },
|
||||
"2": { "submodel": {"dthickpole": { "model": "engineersdecor:hsupport/steel_double_t_support_xconnect_thick_pole_model"}} }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
"transform": "forge:default-block",
|
||||
"custom": {
|
||||
"base": "engineersdecor:steel_framed_window#frame",
|
||||
"Cutout": "engineersdecor:steel_framed_window#frame",
|
||||
"Mipped Cutout": "engineersdecor:steel_framed_window#frame",
|
||||
"Translucent": "engineersdecor:steel_framed_window#pane"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": { "model": "engineersdecor:pipe/straight_pipe_valve_model" },
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"inventory": [{}],
|
||||
"facing": { "north":{"y":0}, "south":{"y":180}, "west":{"y":270}, "east":{"y":90}, "up": {"x":-90}, "down": {"x":90} },
|
||||
"rsdir": { "0":{},"1":{},"2":{},"3":{},"4":{} }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:pipe/straight_pipe_valve_model",
|
||||
"textures": { "side" : "engineersdecor:blocks/pipe/straight_pipe_valve_side_redstone_texture" }
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"inventory": [{}],
|
||||
"facing": { "north":{"y":0}, "south":{"y":180}, "west":{"y":270}, "east":{"y":90}, "up": {"x":-90}, "down": {"x":90} },
|
||||
"rsdir": {
|
||||
"0":{},
|
||||
"1":{ "submodel": {"rsdiru": { "model": "engineersdecor:pipe/straight_pipe_valve_rs_connector_submodel", "x": -90 }} },
|
||||
"2":{ "submodel": {"rsdirr": { "model": "engineersdecor:pipe/straight_pipe_valve_rs_connector_submodel", "y": 90 }} },
|
||||
"3":{ "submodel": {"rsdird": { "model": "engineersdecor:pipe/straight_pipe_valve_rs_connector_submodel", "x": 90 }} },
|
||||
"4":{ "submodel": {"rsdirl": { "model": "engineersdecor:pipe/straight_pipe_valve_rs_connector_submodel", "y": -90 }} }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:pipe/straight_pipe_valve_model",
|
||||
"textures": { "side" : "engineersdecor:blocks/pipe/straight_pipe_valve_side_redstone_analog_texture" }
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"inventory": [{}],
|
||||
"facing": { "north":{"y":0}, "south":{"y":180}, "west":{"y":270}, "east":{"y":90}, "up": {"x":-90}, "down": {"x":90} },
|
||||
"rsdir": {
|
||||
"0":{},
|
||||
"1":{ "submodel": {"rsdiru": { "model": "engineersdecor:pipe/straight_pipe_valve_rs_connector_submodel", "x": -90 }} },
|
||||
"2":{ "submodel": {"rsdirr": { "model": "engineersdecor:pipe/straight_pipe_valve_rs_connector_submodel", "y": 90 }} },
|
||||
"3":{ "submodel": {"rsdird": { "model": "engineersdecor:pipe/straight_pipe_valve_rs_connector_submodel", "x": 90 }} },
|
||||
"4":{ "submodel": {"rsdirl": { "model": "engineersdecor:pipe/straight_pipe_valve_rs_connector_submodel", "y": -90 }} }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:pole/straight_thick_metal_pole_model",
|
||||
"x":-90,
|
||||
"textures": {
|
||||
"particle": "engineersdecor:blocks/pole/thick_steel_pole_side_texture",
|
||||
"side": "engineersdecor:blocks/pole/thick_steel_pole_side_texture",
|
||||
"top": "engineersdecor:blocks/pole/thick_steel_pole_top_texture"
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"facing": { "north": {"y":0}, "south": {"y":0}, "west": {"y":90}, "east": {"y":90}, "up": {"x":90}, "down": {"x":90} },
|
||||
"inventory": [{}]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:pole/straight_thick_metal_pole_head_model",
|
||||
"x":-90,
|
||||
"textures": {
|
||||
"particle": "engineersdecor:blocks/pole/thick_steel_pole_side_texture",
|
||||
"side": "engineersdecor:blocks/pole/thick_steel_pole_side_texture",
|
||||
"top": "engineersdecor:blocks/pole/thick_steel_pole_top_texture"
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"facing": { "north":{"y":0}, "south":{"y":180}, "west":{"y":270}, "east":{"y":90}, "up": {"x":-90}, "down": {"x":90} },
|
||||
"inventory": [{}]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:pole/straight_thin_metal_pole_model",
|
||||
"x":-90,
|
||||
"textures": {
|
||||
"particle": "engineersdecor:blocks/pole/thin_steel_pole_side_texture",
|
||||
"side": "engineersdecor:blocks/pole/thin_steel_pole_side_texture",
|
||||
"top": "engineersdecor:blocks/pole/thin_steel_pole_top_texture"
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"facing": { "north": {"y":0}, "south": {"y":0}, "west": {"y":90}, "east": {"y":90}, "up": {"x":90}, "down": {"x":90} },
|
||||
"inventory": [{}]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "engineersdecor:pole/straight_thin_metal_pole_head_model",
|
||||
"x":-90,
|
||||
"textures": {
|
||||
"particle": "engineersdecor:blocks/pole/thin_steel_pole_side_texture",
|
||||
"side": "engineersdecor:blocks/pole/thin_steel_pole_side_texture",
|
||||
"top": "engineersdecor:blocks/pole/thin_steel_pole_top_texture"
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"facing": { "north":{"y":0}, "south":{"y":180}, "west":{"y":270}, "east":{"y":90}, "up": {"x":-90}, "down": {"x":90} },
|
||||
"inventory": [{}]
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
"transform": "forge:default-block",
|
||||
"custom": {
|
||||
"base": "engineersdecor:treated_wood_window#frame",
|
||||
"Cutout": "engineersdecor:treated_wood_window#frame",
|
||||
"Mipped Cutout": "engineersdecor:treated_wood_window#frame",
|
||||
"Translucent": "engineersdecor:treated_wood_window#pane"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -12,13 +12,13 @@ engineersdecor.tooltip.hint.help=§6[§9CTRL-SHIFT§r Help§6]§r
|
|||
#-----------------------------------------------------------------------------------------------------------
|
||||
# Stone/"ceramic material" based blocks
|
||||
#-----------------------------------------------------------------------------------------------------------
|
||||
tile.engineersdecor.clinker_brick_block.name=Clinker brick
|
||||
tile.engineersdecor.clinker_brick_block.name=Clinker brick block
|
||||
tile.engineersdecor.clinker_brick_block.help=§6A brick block with position dependent texture variations.§r\nLooks slightly darker and more color intensive than the vanilla brick block.
|
||||
tile.engineersdecor.slag_brick_block.name=Slag brick
|
||||
tile.engineersdecor.slag_brick_block.name=Slag brick block
|
||||
tile.engineersdecor.slag_brick_block.help=§6A gray-brown brick block with position dependent texture variations.
|
||||
tile.engineersdecor.rebar_concrete.name=Rebar concrete
|
||||
tile.engineersdecor.rebar_concrete.name=Rebar concrete block
|
||||
tile.engineersdecor.rebar_concrete.help=§6Steel reinforced concrete block.§r Expensive but Creeper-proof like obsidian.
|
||||
tile.engineersdecor.panzerglass_block.name=Panzer glass
|
||||
tile.engineersdecor.panzerglass_block.name=Panzer glass block
|
||||
tile.engineersdecor.panzerglass_block.help=§6Reinforced glass block.§r Expensive, explosion-proof. Dark gray tint, faint structural lines visible, multi texture for seemless look.
|
||||
tile.engineersdecor.rebar_concrete_tile.name=Rebar concrete tile
|
||||
tile.engineersdecor.rebar_concrete_tile.help=§6Steel reinforced concrete tile.§r Expensive but Creeper-proof like obsidian.
|
||||
|
@ -49,20 +49,33 @@ tile.engineersdecor.rebar_concrete_tile_stairs.name=Rebar concrete tile stairs
|
|||
tile.engineersdecor.rebar_concrete_tile_stairs.help=§6Steel reinforced concrete tile stairs.§r Expensive but Creeper-proof like obsidian.
|
||||
#-----------------------------------------------------------------------------------------------------------
|
||||
tile.engineersdecor.treated_wood_pole.name=Straight treated wood pole
|
||||
tile.engineersdecor.treated_wood_pole.help=§6Straight pole fragment with the diameter of a wire relay.§r\n\
|
||||
tile.engineersdecor.treated_wood_pole.help=§6Straight pole fragment with a diameter of a wire relay.§r\n\
|
||||
Can be useful as alternative to the wire posts if special special lengths are needed, \
|
||||
or as support for structures.
|
||||
tile.engineersdecor.treated_wood_pole_head.name=Straight treated wood pole head/foot
|
||||
tile.engineersdecor.treated_wood_pole_head.help=§6Wooden part fitting as foot or head of straight poles.
|
||||
tile.engineersdecor.treated_wood_pole_support.name=Straight treated wood pole support
|
||||
tile.engineersdecor.treated_wood_pole_support.help=§6Heavy duty wooden support part fitting as foot or head of straight poles.
|
||||
tile.engineersdecor.thick_steel_pole.name=Straight thick steel pole
|
||||
tile.engineersdecor.thick_steel_pole.help=§6Straight hollow pole fragment (6x6x16) for structural support purposes.
|
||||
tile.engineersdecor.thin_steel_pole.name=Straight thin steel pole
|
||||
tile.engineersdecor.thin_steel_pole.help=§6Straight hollow pole fragment (4x4x16) for structural support purposes.
|
||||
tile.engineersdecor.thin_steel_pole_head.name=Straight thin steel pole head/foot
|
||||
tile.engineersdecor.thin_steel_pole_head.help=§6Steel part fitting as foot or head of the thin steel pole (4x4x16).
|
||||
tile.engineersdecor.thick_steel_pole_head.name=Straight thick steel pole head/foot
|
||||
tile.engineersdecor.thick_steel_pole_head.help=§6Steel part fitting as foot or head of the thick steel pole (6x6x16).
|
||||
tile.engineersdecor.steel_double_t_support.name=Steel double T support
|
||||
tile.engineersdecor.steel_double_t_support.help=§6Horizontal ceiling support bream fragment.
|
||||
#-----------------------------------------------------------------------------------------------------------
|
||||
tile.engineersdecor.treated_wood_table.name=Treated wood table
|
||||
tile.engineersdecor.treated_wood_table.help=§6Robust four-legged wood table.§r Indoor and outdoor use.
|
||||
tile.engineersdecor.treated_wood_stool.name=Treated wood stool
|
||||
tile.engineersdecor.treated_wood_stool.help=§6Robust wood stool.§r Indoor and outdoor use.
|
||||
tile.engineersdecor.treated_wood_crafting_table.name=Treated wood crafting table
|
||||
tile.engineersdecor.treated_wood_crafting_table.help=§6Robust and weather-proof. Eight storage slots. Keeps inventory.
|
||||
tile.engineersdecor.treated_wood_crafting_table.help=§6Robust and weather-proof.§r Eight storage slots, keeps inventory, no vanilla recipe book.\n\
|
||||
Click up/down arrow buttons for crafting history selection, output slot for item placement, X-button \
|
||||
to clear crafting grid and history. Shift-click stack: player-to-storage stack transfer when crafting \
|
||||
grid empty, otherwise player-to-grid stack transfer. Automatically distributes the clicked stack.
|
||||
tile.engineersdecor.iron_inset_light.name=Inset light
|
||||
tile.engineersdecor.iron_inset_light.help=§6Small glowstone light source, sunk into the floor, ceiling or wall.§r\n\
|
||||
Useful to light up places where electrical light installations are problematic.\
|
||||
|
@ -80,8 +93,30 @@ tile.engineersdecor.small_lab_furnace.help=§6Small metal cased lab kiln.§r Sol
|
|||
Two auxiliary slots e.g. for storage. Two stack internal hopper fifos for input, output, \
|
||||
and fuel. Place an external heater into a aux slot and connect power for electrical \
|
||||
smelting speed boost.
|
||||
tile.engineersdecor.small_electrical_furnace.name=Small electrical furnace
|
||||
tile.engineersdecor.small_electrical_furnace.help=§6Small metal cased pass-through furnace.§r \
|
||||
Automatically draws items from the input side and puts items into the inventory at the output side. \
|
||||
Items can be inserted or drawn from all sides using hoppers. Implicitly bypasses items that cannot be \
|
||||
smelted or cooked to the output. Slightly more energy efficient and faster than a heated cobblestone \
|
||||
furnace. Fifos and feeders transfer whole stacks. Feeders require a bit of power.
|
||||
#-----------------------------------------------------------------------------------------------------------
|
||||
tile.engineersdecor.sign_decor.name=Sign plate (Engineer's decor logo)
|
||||
tile.engineersdecor.straight_pipe_valve.name=Fluid pipe check valve
|
||||
tile.engineersdecor.straight_pipe_valve.help=§6Straight fluid pipe fragment.§r Conducts fluids only in one direction. \
|
||||
Does not connect to the sides. Reduces flow rate. Sneak to place in reverse direction.
|
||||
tile.engineersdecor.straight_pipe_valve_redstone.name=Redstone controlled fluid valve
|
||||
tile.engineersdecor.straight_pipe_valve_redstone.help=§6Straight fluid pipe fragment.§r Conducts fluids only in one direction. \
|
||||
Does not connect to the sides. Sneak to place in reverse direction. \
|
||||
Blocks if not redstone powered.
|
||||
tile.engineersdecor.straight_pipe_valve_redstone_analog.name=Redstone analog fluid valve
|
||||
tile.engineersdecor.straight_pipe_valve_redstone_analog.help=§6Straight fluid pipe fragment.§r Conducts fluids only in one direction. \
|
||||
Does not connect to the sides. Sneak to place in reverse direction. \
|
||||
Blocks if not redstone powered, reduces the flow rate linear from power 1 to 14, \
|
||||
opens to maximum possible valve flow rate for power 15.
|
||||
tile.engineersdecor.passive_fluid_accumulator.name=Passive fluid accumulator
|
||||
tile.engineersdecor.passive_fluid_accumulator.help=§6Vacuum suction based fluid collector.§r Has one output, all other sides are input. \
|
||||
Drains fluids from adjacent tanks when being drained from the output port by a pump.
|
||||
#-----------------------------------------------------------------------------------------------------------
|
||||
tile.engineersdecor.sign_decor.name=Sign plate (Engineer's decor)
|
||||
tile.engineersdecor.sign_decor.help=§6This should not be craftable or visible in JEI. Used for creative tab and screenshots.
|
||||
#-----------------------------------------------------------------------------------------------------------
|
||||
# EOF
|
||||
|
|
|
@ -56,6 +56,16 @@ tile.engineersdecor.treated_wood_pole_head.name=Прямой обработан
|
|||
#tile.engineersdecor.treated_wood_pole_head.help=§6Wooden part fitting as foot or head of straight poles.
|
||||
tile.engineersdecor.treated_wood_pole_support.name=Прямой обработанный деревянный столб
|
||||
#tile.engineersdecor.treated_wood_pole_support.help=§6Heavy duty wooden support part fitting as foot or head of straight poles.
|
||||
tile.engineersdecor.thick_steel_pole.name=Straight thick steel pole
|
||||
#tile.engineersdecor.thick_steel_pole.help=§6Straight hollow pole fragment (6x6x16) for structural support purposes.
|
||||
tile.engineersdecor.thin_steel_pole.name=Straight thin steel pole
|
||||
#tile.engineersdecor.thin_steel_pole.help=§6Straight hollow pole fragment (4x4x16) for structural support purposes.
|
||||
tile.engineersdecor.thin_steel_pole_head.name=Straight thin steel pole head/foot
|
||||
#tile.engineersdecor.thin_steel_pole_head.help=§6Steel part fitting as foot or head of the thin steel pole (4x4x16).
|
||||
tile.engineersdecor.thick_steel_pole_head.name=Straight thick steel pole head/foot
|
||||
#tile.engineersdecor.thick_steel_pole_head.help=§6Steel part fitting as foot or head of the thick steel pole (6x6x16).
|
||||
tile.engineersdecor.steel_double_t_support.name=Steel double T support
|
||||
#tile.engineersdecor.steel_double_t_support.help=§6Horizontal ceiling support bream fragment.
|
||||
#-----------------------------------------------------------------------------------------------------------
|
||||
tile.engineersdecor.treated_wood_table.name=Стол из обработанного дерева
|
||||
tile.engineersdecor.treated_wood_table.help=§6Прочный деревянный стол с четырьмя ножками .§r Для использования в помещении и на улице.
|
||||
|
@ -76,6 +86,28 @@ tile.engineersdecor.steel_framed_window.name=Окно со стальной ра
|
|||
#-----------------------------------------------------------------------------------------------------------
|
||||
tile.engineersdecor.small_lab_furnace.name=Компактная лабораторная печь
|
||||
tile.engineersdecor.small_lab_furnace.help=§6Лабораторная печь в металлическом корпусе.§r Подача твёрдого топлива - сверху. Немного горячее чем каменная, поэтому быстрее. Два внутренних слота для ввода, выхода и топлива.
|
||||
tile.engineersdecor.small_electrical_furnace.name=Small electrical furnace
|
||||
#tile.engineersdecor.small_electrical_furnace.help=§6Small metal cased pass-through furnace.§r \
|
||||
Automatically draws items from the input side and puts items into the inventory at the output side. \
|
||||
Items can be inserted or drawn from all sides using hoppers. Implicitly bypasses items that cannot be \
|
||||
smelted or cooked to the output. Slightly more energy efficient and faster than a heated cobblestone \
|
||||
furnace. Fifos and feeders transfer whole stacks. Feeders require a bit of power.
|
||||
#-----------------------------------------------------------------------------------------------------------
|
||||
tile.engineersdecor.straight_pipe_valve.name=Straight fluid valve
|
||||
#tile.engineersdecor.straight_pipe_valve.help=§6Straight fluid pipe fragment.§r Conducts fluids only in one direction. \
|
||||
Does not connect to the sides. Reduces flow rate. Sneak to place in reverse direction.
|
||||
tile.engineersdecor.straight_pipe_valve_redstone.name=Redstone controlled fluid valve
|
||||
#tile.engineersdecor.straight_pipe_valve_redstone.help=§6Straight fluid pipe fragment.§r Conducts fluids only in one direction. \
|
||||
Does not connect to the sides. Sneak to place in reverse direction. \
|
||||
Blocks if not redstone powered.
|
||||
tile.engineersdecor.straight_pipe_valve_redstone_analog.name=Redstone analog fluid valve
|
||||
#tile.engineersdecor.straight_pipe_valve_redstone_analog.help=§6Straight fluid pipe fragment.§r Conducts fluids only in one direction. \
|
||||
Does not connect to the sides. Sneak to place in reverse direction. \
|
||||
Blocks if not redstone powered, reduces the flow rate linear from power 1 to 14, \
|
||||
opens to maximum possible valve flow rate for power 15.
|
||||
tile.engineersdecor.passive_fluid_accumulator.name=Passive fluid accumulator
|
||||
#tile.engineersdecor.passive_fluid_accumulator.help=§6Vacuum suction based fluid collector.§r Has one output, all other sides are input. \
|
||||
Drains fluids from adjacent tanks when being drained from the output port by a pump.
|
||||
#-----------------------------------------------------------------------------------------------------------
|
||||
tile.engineersdecor.sign_decor.name=Sign plate (Engineer's decor logo)
|
||||
#tile.engineersdecor.sign_decor.help=§6This should not be craftable or visible in JEI. Used for creative tab and screenshots.
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{ "parent": "block/cube_all", "textures": { "all": "engineersdecor:blocks/clinker_brick/clinker_brick_texture0" } }
|
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"top": "engineersdecor:blocks/furnace/small_electrical_furnace_top",
|
||||
"particle": "engineersdecor:blocks/furnace/small_electrical_furnace_top",
|
||||
"bottom": "engineersdecor:blocks/furnace/small_electrical_furnace_bottom",
|
||||
"left": "engineersdecor:blocks/furnace/small_electrical_furnace_left",
|
||||
"right": "engineersdecor:blocks/furnace/small_electrical_furnace_right",
|
||||
"front": "engineersdecor:blocks/furnace/small_electrical_furnace_front",
|
||||
"back": "engineersdecor:blocks/furnace/small_electrical_furnace_back"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [12.75, 11.5, 1],
|
||||
"to": [13.75, 17, 15],
|
||||
"rotation": {"angle": 45, "axis": "z", "origin": [15.5, 13.5, 8]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 1, 5.5], "texture": "#front"},
|
||||
"east": {"uv": [0, 1, 5, 15], "rotation": 90, "texture": "#top"},
|
||||
"south": {"uv": [0, 0, 1, 5.5], "texture": "#back"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [2.25, 11.5, 1],
|
||||
"to": [3.25, 17, 15],
|
||||
"rotation": {"angle": -45, "axis": "z", "origin": [0.5, 13.5, 8]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 1, 5.5], "texture": "#front"},
|
||||
"south": {"uv": [0, 0, 1, 5.5], "texture": "#back"},
|
||||
"west": {"uv": [0, 1, 5, 15], "rotation": 270, "texture": "#top"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [4, 14, 0],
|
||||
"to": [12, 16, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [4, 0, 12, 2], "texture": "#front"},
|
||||
"east": {"uv": [0, 0, 16, 2], "texture": "#left"},
|
||||
"south": {"uv": [4, 0, 12, 2], "texture": "#back"},
|
||||
"west": {"uv": [0, 0, 16, 2], "texture": "#right"},
|
||||
"up": {"uv": [4, 0, 12, 16], "texture": "#top"},
|
||||
"down": {"uv": [4, 0, 12, 16], "texture": "#bottom"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [2, 12, 0],
|
||||
"to": [14, 13, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [2, 3, 14, 4], "texture": "#front"},
|
||||
"east": {"uv": [0, 3, 16, 4], "texture": "#left"},
|
||||
"south": {"uv": [2, 3, 14, 4], "texture": "#back"},
|
||||
"west": {"uv": [0, 3, 16, 4], "texture": "#right"},
|
||||
"up": {"uv": [2, 0, 14, 16], "texture": "#top"},
|
||||
"down": {"uv": [2, 0, 14, 16], "texture": "#bottom"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [1, 11, 0],
|
||||
"to": [15, 12, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [1, 4, 15, 5], "texture": "#front"},
|
||||
"east": {"uv": [0, 4, 16, 5], "texture": "#left"},
|
||||
"south": {"uv": [1, 4, 15, 5], "texture": "#back"},
|
||||
"west": {"uv": [0, 4, 16, 5], "texture": "#right"},
|
||||
"up": {"uv": [1, 0, 15, 16], "texture": "#top"},
|
||||
"down": {"uv": [1, 0, 15, 16], "texture": "#bottom"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [3, 13, 0],
|
||||
"to": [13, 14, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [3, 2, 13, 3], "texture": "#front"},
|
||||
"east": {"uv": [0, 2, 16, 3], "texture": "#left"},
|
||||
"south": {"uv": [3, 2, 13, 3], "texture": "#back"},
|
||||
"west": {"uv": [0, 2, 16, 3], "texture": "#right"},
|
||||
"up": {"uv": [3, 0, 13, 16], "texture": "#top"},
|
||||
"down": {"uv": [3, 0, 13, 16], "texture": "#bottom"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [0, 0, 0],
|
||||
"to": [16, 11, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 5, 16, 16], "texture": "#front"},
|
||||
"east": {"uv": [0, 5, 16, 16], "texture": "#right"},
|
||||
"south": {"uv": [0, 5, 16, 16], "texture": "#back"},
|
||||
"west": {"uv": [0, 5, 16, 16], "texture": "#left"},
|
||||
"up": {"uv": [0, 0, 16, 16], "texture": "#top"},
|
||||
"down": {"uv": [0, 0, 16, 16], "texture": "#bottom"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"ground": {
|
||||
"scale": [0.2, 0.2, 0.2]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [30, 225, 0],
|
||||
"scale": [0.625, 0.625, 0.625]
|
||||
},
|
||||
"fixed": {
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
"parent": "block/cube",
|
||||
"ambientocclusion": false,
|
||||
"textures": {
|
||||
"frame": "engineersdecor:blocks/iestyle/steel_texture",
|
||||
"particle": "engineersdecor:blocks/iestyle/steel_texture"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
"parent": "block/cube",
|
||||
"ambientocclusion": false,
|
||||
"textures": {
|
||||
"frame": "engineersdecor:blocks/iestyle/treated_wood_rough_texture",
|
||||
"particle": "engineersdecor:blocks/iestyle/treated_wood_rough_texture"
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
{
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"end": "engineersdecor:blocks/hsupport/steel_double_t_support_end_texture",
|
||||
"particle": "engineersdecor:blocks/hsupport/steel_double_t_support_end_texture",
|
||||
"side": "engineersdecor:blocks/hsupport/steel_double_t_support_side_texture",
|
||||
"top": "engineersdecor:blocks/hsupport/steel_double_t_support_top_texture"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [5, 15, 0],
|
||||
"to": [11, 16, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [5, 0, 11, 1], "texture": "#end"},
|
||||
"east": {"uv": [0, 0, 16, 1], "texture": "#side"},
|
||||
"south": {"uv": [5, 0, 11, 1], "texture": "#end"},
|
||||
"west": {"uv": [0, 0, 16, 1], "texture": "#side"},
|
||||
"up": {"uv": [5, 0, 11, 16], "texture": "#top"},
|
||||
"down": {"uv": [5, 0, 11, 16], "texture": "#top"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [9, 12, 0],
|
||||
"to": [10, 15, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [6, 1, 7, 4], "texture": "#end"},
|
||||
"east": {"uv": [0, 1, 16, 4], "texture": "#side"},
|
||||
"south": {"uv": [9, 1, 10, 4], "texture": "#end"},
|
||||
"west": {"uv": [0, 1, 16, 4], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [6, 12, 0],
|
||||
"to": [7, 15, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [9, 1, 10, 4], "texture": "#end"},
|
||||
"east": {"uv": [0, 1, 16, 4], "texture": "#side"},
|
||||
"south": {"uv": [6, 1, 7, 4], "texture": "#end"},
|
||||
"west": {"uv": [0, 1, 16, 4], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [5, 11, 0],
|
||||
"to": [11, 12, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [5, 4, 11, 5], "texture": "#end"},
|
||||
"east": {"uv": [0, 4, 16, 5], "texture": "#side"},
|
||||
"south": {"uv": [5, 4, 11, 5], "texture": "#end"},
|
||||
"west": {"uv": [0, 4, 16, 5], "texture": "#side"},
|
||||
"up": {"uv": [5, 0, 11, 16], "texture": "#top"},
|
||||
"down": {"uv": [5, 0, 11, 16], "texture": "#top"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"ground": {
|
||||
"scale": [0.2, 0.2, 0.2]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [30, 225, 0],
|
||||
"scale": [0.625, 0.625, 0.625]
|
||||
},
|
||||
"fixed": {
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
},
|
||||
"firstperson_righthand": {
|
||||
"scale": [0.5, 0.5, 0.5],
|
||||
"rotation": [120, 30, 0],
|
||||
"translation": [2, 3, 0]
|
||||
},
|
||||
"thirdperson_righthand": {
|
||||
"scale": [0.5, 0.5, 0.5],
|
||||
"rotation": [120, 15, 0],
|
||||
"translation": [-1, -1, -2]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"end": "engineersdecor:blocks/hsupport/steel_double_t_support_end_texture",
|
||||
"particle": "engineersdecor:blocks/hsupport/steel_double_t_support_end_texture",
|
||||
"side": "engineersdecor:blocks/hsupport/steel_double_t_support_side_texture",
|
||||
"top": "engineersdecor:blocks/hsupport/steel_double_t_support_top_texture"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [11, 15, 5],
|
||||
"to": [16, 16, 11],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 5, 1], "texture": "#side"},
|
||||
"east": {"uv": [5, 0, 11, 1], "texture": "#end"},
|
||||
"south": {"uv": [11, 0, 16, 1], "texture": "#side"},
|
||||
"up": {"uv": [5, 10, 11, 16], "rotation": 270, "texture": "#top"},
|
||||
"down": {"uv": [11, 5, 16, 11], "rotation": 90, "texture": "#top"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [11, 11, 5],
|
||||
"to": [16, 12, 11],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 4, 5, 5], "texture": "#side"},
|
||||
"east": {"uv": [5, 4, 11, 5], "texture": "#end"},
|
||||
"south": {"uv": [11, 4, 16, 5], "texture": "#side"},
|
||||
"up": {"uv": [11, 5, 16, 11], "rotation": 270, "texture": "#top"},
|
||||
"down": {"uv": [5, 10, 11, 16], "rotation": 90, "texture": "#top"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [10, 12, 9],
|
||||
"to": [16, 15, 10],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 1, 6, 4], "texture": "#side"},
|
||||
"east": {"uv": [6, 1, 7, 4], "texture": "#end"},
|
||||
"south": {"uv": [10, 1, 16, 4], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [10, 12, 6],
|
||||
"to": [16, 15, 7],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 1, 6, 4], "texture": "#side"},
|
||||
"east": {"uv": [9, 1, 10, 4], "texture": "#end"},
|
||||
"south": {"uv": [10, 1, 16, 4], "texture": "#side"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"ground": {
|
||||
"scale": [0.2, 0.2, 0.2]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [30, 225, 0],
|
||||
"scale": [0.625, 0.625, 0.625]
|
||||
},
|
||||
"fixed": {
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"pside": "engineersdecor:blocks/pole/thick_steel_pole_side_texture",
|
||||
"particle": "engineersdecor:blocks/pole/thick_steel_pole_side_texture",
|
||||
"ptop": "engineersdecor:blocks/pole/thick_steel_pole_top_texture"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 0, 10],
|
||||
"to": [10, 11, 11],
|
||||
"faces": {
|
||||
"north": {"uv": [6, 5, 10, 16], "texture": "#pside"},
|
||||
"south": {"uv": [6, 5, 10, 16], "texture": "#pside"},
|
||||
"down": {"uv": [6, 5, 10, 6], "texture": "#ptop"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [10, 0, 5],
|
||||
"to": [11, 11, 11],
|
||||
"faces": {
|
||||
"north": {"uv": [5, 5, 6, 16], "texture": "#pside"},
|
||||
"east": {"uv": [5, 5, 11, 16], "texture": "#pside"},
|
||||
"south": {"uv": [10, 5, 11, 16], "texture": "#pside"},
|
||||
"west": {"uv": [5, 5, 11, 16], "texture": "#pside"},
|
||||
"down": {"uv": [10, 5, 11, 11], "texture": "#ptop"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [5, 0, 5],
|
||||
"to": [6, 11, 11],
|
||||
"faces": {
|
||||
"north": {"uv": [10, 5, 11, 16], "texture": "#pside"},
|
||||
"east": {"uv": [5, 5, 11, 16], "texture": "#pside"},
|
||||
"south": {"uv": [5, 5, 6, 16], "texture": "#pside"},
|
||||
"west": {"uv": [5, 5, 11, 16], "texture": "#pside"},
|
||||
"down": {"uv": [5, 5, 6, 11], "texture": "#ptop"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [6, 0, 5],
|
||||
"to": [10, 11, 6],
|
||||
"faces": {
|
||||
"north": {"uv": [6, 5, 10, 16], "texture": "#pside"},
|
||||
"south": {"uv": [6, 5, 10, 16], "texture": "#pside"},
|
||||
"down": {"uv": [6, 10, 10, 11], "texture": "#ptop"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"ground": {
|
||||
"scale": [0.2, 0.2, 0.2]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [30, 225, 0],
|
||||
"scale": [0.625, 0.625, 0.625]
|
||||
},
|
||||
"fixed": {
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"pside": "engineersdecor:blocks/pole/thin_steel_pole_side_texture",
|
||||
"particle": "engineersdecor:blocks/pole/thin_steel_pole_side_texture",
|
||||
"ptop": "engineersdecor:blocks/pole/thin_steel_pole_top_texture"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [7, 0, 9],
|
||||
"to": [9, 11, 10],
|
||||
"faces": {
|
||||
"north": {"uv": [7, 5, 9, 16], "texture": "#pside"},
|
||||
"south": {"uv": [7, 5, 9, 16], "texture": "#pside"},
|
||||
"down": {"uv": [7, 6, 9, 7], "texture": "#ptop"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [9, 0, 6],
|
||||
"to": [10, 11, 10],
|
||||
"faces": {
|
||||
"north": {"uv": [6, 5, 7, 16], "texture": "#pside"},
|
||||
"east": {"uv": [6, 5, 10, 16], "texture": "#pside"},
|
||||
"south": {"uv": [9, 5, 10, 16], "texture": "#pside"},
|
||||
"west": {"uv": [6, 5, 10, 16], "texture": "#pside"},
|
||||
"down": {"uv": [9, 6, 10, 10], "texture": "#ptop"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [6, 0, 6],
|
||||
"to": [7, 11, 10],
|
||||
"faces": {
|
||||
"north": {"uv": [9, 5, 10, 16], "texture": "#pside"},
|
||||
"east": {"uv": [6, 5, 10, 16], "texture": "#pside"},
|
||||
"south": {"uv": [6, 5, 7, 16], "texture": "#pside"},
|
||||
"west": {"uv": [6, 5, 10, 16], "texture": "#pside"},
|
||||
"down": {"uv": [6, 6, 7, 10], "texture": "#ptop"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [7, 0, 6],
|
||||
"to": [9, 11, 7],
|
||||
"faces": {
|
||||
"north": {"uv": [7, 5, 9, 16], "texture": "#pside"},
|
||||
"south": {"uv": [7, 5, 9, 16], "texture": "#pside"},
|
||||
"down": {"uv": [7, 9, 9, 10], "texture": "#ptop"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"ground": {
|
||||
"scale": [0.2, 0.2, 0.2]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [30, 225, 0],
|
||||
"scale": [0.625, 0.625, 0.625]
|
||||
},
|
||||
"fixed": {
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
"textures": {
|
||||
"end": "engineersdecor:blocks/pipe/passive_fluid_accumulator_front_texture",
|
||||
"particle": "engineersdecor:blocks/pipe/passive_fluid_accumulator_front_texture",
|
||||
"side": "engineersdecor:blocks/pipe/passive_fluid_accumulator_side_texture",
|
||||
"back": "engineersdecor:blocks/pipe/passive_fluid_accumulator_back_texture"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [3, 3, 0],
|
||||
"to": [13, 13, 1],
|
||||
"faces": {
|
||||
"north": {"uv": [3, 3, 13, 13], "texture": "#end"},
|
||||
"east": {"uv": [15, 4, 16, 16], "texture": "#side"},
|
||||
"west": {"uv": [0, 4, 1, 16], "texture": "#side"},
|
||||
"up": {"uv": [4, 0, 16, 1], "texture": "#side"},
|
||||
"down": {"uv": [0, 15, 12, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [0, 0, 1],
|
||||
"to": [16, 16, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 16, 16], "texture": "#end"},
|
||||
"east": {"uv": [0, 0, 15, 16], "texture": "#side"},
|
||||
"south": {"uv": [0, 0, 16, 16], "texture": "#back"},
|
||||
"west": {"uv": [1, 0, 16, 16], "texture": "#side"},
|
||||
"up": {"uv": [0, 0, 16, 15], "texture": "#side"},
|
||||
"down": {"uv": [0, 0, 16, 15], "rotation": 180, "texture": "#side"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"thirdperson_righthand": {
|
||||
"rotation": [120, 15, 0],
|
||||
"translation": [-1, -1, -2],
|
||||
"scale": [0.4, 0.4, 0.4]
|
||||
},
|
||||
"firstperson_righthand": {
|
||||
"rotation": [120, 30, 0],
|
||||
"translation": [2, 3, 0],
|
||||
"scale": [0.4, 0.4, 0.4]
|
||||
},
|
||||
"ground": {
|
||||
"scale": [0.2, 0.2, 0.2]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [30, 225, 0],
|
||||
"scale": [0.625, 0.625, 0.625]
|
||||
},
|
||||
"fixed": {
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
{
|
||||
"textures": {
|
||||
"end": "engineersdecor:blocks/pipe/straight_pipe_valve_end_texture",
|
||||
"particle": "engineersdecor:blocks/pipe/straight_pipe_valve_end_texture",
|
||||
"side": "engineersdecor:blocks/pipe/straight_pipe_valve_side_texture"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [2, 2, 0],
|
||||
"to": [14, 14, 2],
|
||||
"faces": {
|
||||
"north": {"uv": [2, 2, 14, 14], "texture": "#end"},
|
||||
"east": {"uv": [2, 0, 14, 2], "rotation": 90, "texture": "#side"},
|
||||
"south": {"uv": [2, 2, 14, 14], "texture": "#end"},
|
||||
"west": {"uv": [2, 0, 14, 2], "rotation": 270, "texture": "#side"},
|
||||
"up": {"uv": [2, 0, 14, 2], "texture": "#side"},
|
||||
"down": {"uv": [2, 14, 14, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [2, 2, 14],
|
||||
"to": [14, 14, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [2, 2, 14, 14], "texture": "#end"},
|
||||
"east": {"uv": [2, 14, 14, 16], "rotation": 90, "texture": "#side"},
|
||||
"south": {"uv": [2, 2, 14, 14], "texture": "#end"},
|
||||
"west": {"uv": [2, 0, 14, 2], "rotation": 90, "texture": "#side"},
|
||||
"up": {"uv": [2, 14, 14, 16], "texture": "#side"},
|
||||
"down": {"uv": [2, 0, 14, 2], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [4, 4, 11],
|
||||
"to": [12, 12, 14],
|
||||
"faces": {
|
||||
"east": {"uv": [4, 11, 12, 14], "rotation": 90, "texture": "#side"},
|
||||
"west": {"uv": [4, 11, 12, 14], "rotation": 270, "texture": "#side"},
|
||||
"up": {"uv": [4, 11, 12, 14], "texture": "#side"},
|
||||
"down": {"uv": [4, 11, 12, 14], "rotation": 180, "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [4, 4, 2],
|
||||
"to": [12, 12, 5],
|
||||
"faces": {
|
||||
"east": {"uv": [4, 11, 12, 14], "rotation": 90, "texture": "#side"},
|
||||
"west": {"uv": [4, 11, 12, 14], "rotation": 270, "texture": "#side"},
|
||||
"up": {"uv": [4, 2, 12, 5], "texture": "#side"},
|
||||
"down": {"uv": [4, 2, 12, 5], "rotation": 180, "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [3, 3, 5],
|
||||
"to": [13, 13, 11],
|
||||
"faces": {
|
||||
"north": {"uv": [4, 4, 12, 12], "texture": "#end"},
|
||||
"east": {"uv": [3, 5, 13, 11], "rotation": 90, "texture": "#side"},
|
||||
"south": {"uv": [4, 4, 12, 12], "texture": "#end"},
|
||||
"west": {"uv": [3, 5, 13, 11], "rotation": 270, "texture": "#side"},
|
||||
"up": {"uv": [3, 5, 13, 11], "texture": "#side"},
|
||||
"down": {"uv": [3, 5, 13, 11], "rotation": 180, "texture": "#side"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"thirdperson_righthand": {
|
||||
"rotation": [120, 15, 0],
|
||||
"translation": [-1, -1, -2],
|
||||
"scale": [0.4, 0.4, 0.4]
|
||||
},
|
||||
"firstperson_righthand": {
|
||||
"rotation": [120, 30, 0],
|
||||
"translation": [2, 3, 0],
|
||||
"scale": [0.4, 0.4, 0.4]
|
||||
},
|
||||
"ground": {
|
||||
"scale": [0.2, 0.2, 0.2]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [30, 225, 0],
|
||||
"scale": [0.625, 0.625, 0.625]
|
||||
},
|
||||
"fixed": {
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
"textures": {
|
||||
"rsside": "engineersdecor:blocks/pipe/straight_pipe_valve_side_redstone_texture",
|
||||
"particle": "engineersdecor:blocks/pipe/straight_pipe_valve_side_redstone_texture",
|
||||
"rsend": "engineersdecor:blocks/pipe/straight_pipe_valve_side_redstone_cn_texture"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [5, 5, 2],
|
||||
"to": [11, 11, 3],
|
||||
"faces": {
|
||||
"north": {"uv": [5, 5, 11, 11], "rotation": 90, "texture": "#rsend"},
|
||||
"east": {"uv": [13, 5, 14, 11], "texture": "#rsside"},
|
||||
"west": {"uv": [13, 5, 14, 11], "rotation": 180, "texture": "#rsside"},
|
||||
"up": {"uv": [13, 5, 14, 11], "rotation": 270, "texture": "#rsside"},
|
||||
"down": {"uv": [13, 5, 14, 11], "rotation": 90, "texture": "#rsside"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [4, 4, 0],
|
||||
"to": [12, 12, 2],
|
||||
"faces": {
|
||||
"north": {"uv": [4, 4, 12, 12], "rotation": 90, "texture": "#rsend"},
|
||||
"east": {"uv": [13, 4, 16, 12], "texture": "#rsside"},
|
||||
"south": {"uv": [4, 4, 12, 12], "texture": "#rsend"},
|
||||
"west": {"uv": [13, 4, 16, 12], "rotation": 180, "texture": "#rsside"},
|
||||
"up": {"uv": [13, 4, 16, 12], "rotation": 270, "texture": "#rsside"},
|
||||
"down": {"uv": [13, 4, 16, 12], "rotation": 90, "texture": "#rsside"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"thirdperson_righthand": {
|
||||
"rotation": [120, 15, 0],
|
||||
"translation": [-1, -1, -2],
|
||||
"scale": [0.4, 0.4, 0.4]
|
||||
},
|
||||
"firstperson_righthand": {
|
||||
"rotation": [120, 30, 0],
|
||||
"translation": [2, 3, 0],
|
||||
"scale": [0.4, 0.4, 0.4]
|
||||
},
|
||||
"ground": {
|
||||
"scale": [0.2, 0.2, 0.2]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [30, 225, 0],
|
||||
"scale": [0.625, 0.625, 0.625]
|
||||
},
|
||||
"fixed": {
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
{
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"side": "engineersdecor:blocks/pole/thick_steel_pole_side_texture",
|
||||
"particle": "engineersdecor:blocks/pole/thick_steel_pole_side_texture",
|
||||
"top": "engineersdecor:blocks/pole/thick_steel_pole_top_texture"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 10, 0],
|
||||
"to": [10, 11, 14],
|
||||
"faces": {
|
||||
"north": {"uv": [6, 5, 10, 6], "texture": "#top"},
|
||||
"up": {"uv": [6, 0, 10, 16], "texture": "#side"},
|
||||
"down": {"uv": [6, 0, 10, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [10, 5, 0],
|
||||
"to": [11, 11, 14],
|
||||
"faces": {
|
||||
"north": {"uv": [5, 5, 6, 11], "texture": "#top", "cullface": "north"},
|
||||
"east": {"uv": [5, 0, 11, 16], "rotation": 90, "texture": "#side"},
|
||||
"west": {"uv": [5, 0, 11, 16], "rotation": 90, "texture": "#side"},
|
||||
"up": {"uv": [10, 0, 11, 16], "texture": "#side"},
|
||||
"down": {"uv": [10, 0, 11, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [5, 5, 0],
|
||||
"to": [6, 11, 14],
|
||||
"faces": {
|
||||
"north": {"uv": [10, 5, 11, 11], "texture": "#top", "cullface": "north"},
|
||||
"east": {"uv": [5, 0, 11, 16], "rotation": 90, "texture": "#side"},
|
||||
"west": {"uv": [5, 0, 11, 16], "rotation": 90, "texture": "#side"},
|
||||
"up": {"uv": [5, 0, 6, 16], "texture": "#side"},
|
||||
"down": {"uv": [5, 0, 6, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [6, 5, 0],
|
||||
"to": [10, 6, 14],
|
||||
"faces": {
|
||||
"north": {"uv": [6, 10, 10, 11], "texture": "#top"},
|
||||
"up": {"uv": [6, 0, 10, 16], "texture": "#side"},
|
||||
"down": {"uv": [6, 0, 10, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [3, 3, 14],
|
||||
"to": [13, 13, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [4, 4, 12, 12], "texture": "#top", "cullface": "north"},
|
||||
"east": {"uv": [4, 5, 6, 13], "texture": "#side"},
|
||||
"south": {"uv": [3, 3, 13, 13], "texture": "#top", "cullface": "south"},
|
||||
"west": {"uv": [14, 4, 16, 12], "texture": "#side"},
|
||||
"up": {"uv": [12, 4, 14, 12], "rotation": 90, "texture": "#side"},
|
||||
"down": {"uv": [10, 1, 12, 10], "rotation": 90, "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [6, 11, 13],
|
||||
"to": [10, 11.5, 15],
|
||||
"rotation": {"angle": -45, "axis": "x", "origin": [8, 11.25, 14]},
|
||||
"faces": {
|
||||
"east": {"uv": [2, 5.5, 4, 6], "texture": "#top"},
|
||||
"west": {"uv": [12, 5.5, 14, 6], "texture": "#top"},
|
||||
"up": {"uv": [6, 13, 10, 15], "texture": "#top"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [6, 4.5, 13],
|
||||
"to": [10, 5, 15],
|
||||
"rotation": {"angle": 45, "axis": "x", "origin": [8, 4.75, 14]},
|
||||
"faces": {
|
||||
"east": {"uv": [2, 5.5, 4, 6], "texture": "#top"},
|
||||
"west": {"uv": [12, 5.5, 14, 6], "texture": "#top"},
|
||||
"down": {"uv": [6, 1, 10, 3], "texture": "#top"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [4.5, 6, 13],
|
||||
"to": [5, 10, 15],
|
||||
"rotation": {"angle": -45, "axis": "y", "origin": [4.75, 8, 14]},
|
||||
"faces": {
|
||||
"west": {"uv": [6, 1, 10, 3], "rotation": 270, "texture": "#top"},
|
||||
"up": {"uv": [12, 5.5, 14, 6], "rotation": 90, "texture": "#top"},
|
||||
"down": {"uv": [2, 5.5, 4, 6], "rotation": 270, "texture": "#top"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [11, 6, 13],
|
||||
"to": [11.5, 10, 15],
|
||||
"rotation": {"angle": 45, "axis": "y", "origin": [11.25, 8, 14]},
|
||||
"faces": {
|
||||
"east": {"uv": [6, 13, 10, 15], "rotation": 270, "texture": "#top"},
|
||||
"up": {"uv": [12, 5.5, 14, 6], "rotation": 90, "texture": "#top"},
|
||||
"down": {"uv": [2, 5.5, 4, 6], "rotation": 270, "texture": "#top"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"ground": {
|
||||
"scale": [0.2, 0.2, 0.2]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [30, 225, 0],
|
||||
"scale": [0.625, 0.625, 0.625]
|
||||
},
|
||||
"fixed": {
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"side": "engineersdecor:blocks/pole/thick_steel_pole_side_texture",
|
||||
"particle": "engineersdecor:blocks/pole/thick_steel_pole_side_texture",
|
||||
"top": "engineersdecor:blocks/pole/thick_steel_pole_top_texture"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 10, 0],
|
||||
"to": [10, 11, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [6, 5, 9.5, 5.75], "texture": "#top"},
|
||||
"south": {"uv": [6, 6, 9.5, 6.75], "texture": "#top"},
|
||||
"up": {"uv": [6.25, 0, 9.75, 16], "texture": "#side"},
|
||||
"down": {"uv": [6.25, 0, 9.75, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [10, 5, 0],
|
||||
"to": [11, 11, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [5, 5, 5.75, 10], "texture": "#top", "cullface": "north"},
|
||||
"east": {"uv": [5, 0, 11, 16], "rotation": 90, "texture": "#side"},
|
||||
"south": {"uv": [10, 5, 10.75, 10], "texture": "#top", "cullface": "south"},
|
||||
"west": {"uv": [5, 0, 11, 16], "rotation": 90, "texture": "#side"},
|
||||
"up": {"uv": [10, 0, 11, 16], "texture": "#side"},
|
||||
"down": {"uv": [10, 0, 10.75, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [5, 5, 0],
|
||||
"to": [6, 11, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [10, 6, 10.75, 11], "texture": "#top", "cullface": "north"},
|
||||
"east": {"uv": [5, 0, 11, 16], "rotation": 90, "texture": "#side"},
|
||||
"south": {"uv": [5, 6, 5.75, 11], "texture": "#top", "cullface": "south"},
|
||||
"west": {"uv": [5, 0, 11, 16], "rotation": 90, "texture": "#side"},
|
||||
"up": {"uv": [5, 0, 6, 16], "texture": "#side"},
|
||||
"down": {"uv": [5, 0, 5.75, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [6, 5, 0],
|
||||
"to": [10, 6, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [6, 10, 9.5, 10.75], "texture": "#top"},
|
||||
"south": {"uv": [6, 10, 9.5, 10.75], "texture": "#top"},
|
||||
"up": {"uv": [6.25, 0, 9.75, 16], "texture": "#side"},
|
||||
"down": {"uv": [6.25, 0, 9.75, 16], "texture": "#side"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"ground": {
|
||||
"scale": [0.2, 0.2, 0.2]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [30, 225, 0],
|
||||
"scale": [0.625, 0.625, 0.625]
|
||||
},
|
||||
"fixed": {
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
{
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"side": "engineersdecor:blocks/pole/thin_steel_pole_side_texture",
|
||||
"particle": "engineersdecor:blocks/pole/thin_steel_pole_side_texture",
|
||||
"top": "engineersdecor:blocks/pole/thin_steel_pole_top_texture"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [7, 9, 0],
|
||||
"to": [9, 10, 14],
|
||||
"faces": {
|
||||
"north": {"uv": [7, 6, 9, 7], "texture": "#top"},
|
||||
"south": {"uv": [7, 6, 9, 7], "texture": "#top"},
|
||||
"up": {"uv": [7, 0, 9, 16], "texture": "#side"},
|
||||
"down": {"uv": [7, 0, 9, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [9, 6, 0],
|
||||
"to": [10, 10, 14],
|
||||
"faces": {
|
||||
"north": {"uv": [6, 6, 7, 10], "texture": "#top", "cullface": "north"},
|
||||
"east": {"uv": [6, 0, 10, 16], "rotation": 90, "texture": "#side"},
|
||||
"south": {"uv": [9, 6, 10, 10], "texture": "#top", "cullface": "south"},
|
||||
"west": {"uv": [6, 0, 10, 16], "rotation": 90, "texture": "#side"},
|
||||
"up": {"uv": [9, 0, 10, 16], "texture": "#side"},
|
||||
"down": {"uv": [9, 0, 10, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [6, 6, 0],
|
||||
"to": [7, 10, 14],
|
||||
"faces": {
|
||||
"north": {"uv": [9, 6, 10, 10], "texture": "#top", "cullface": "north"},
|
||||
"east": {"uv": [6, 0, 10, 16], "rotation": 90, "texture": "#side"},
|
||||
"south": {"uv": [6, 6, 7, 10], "texture": "#top", "cullface": "south"},
|
||||
"west": {"uv": [6, 0, 10, 16], "rotation": 90, "texture": "#side"},
|
||||
"up": {"uv": [6, 0, 7, 16], "texture": "#side"},
|
||||
"down": {"uv": [6, 0, 7, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [7, 6, 0],
|
||||
"to": [9, 7, 14],
|
||||
"faces": {
|
||||
"north": {"uv": [7, 9, 9, 10], "texture": "#top"},
|
||||
"south": {"uv": [7, 9, 9, 10], "texture": "#top"},
|
||||
"up": {"uv": [7, 0, 9, 16], "texture": "#side"},
|
||||
"down": {"uv": [7, 0, 9, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [4, 4, 14],
|
||||
"to": [12, 12, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [4, 4, 12, 12], "texture": "#top", "cullface": "north"},
|
||||
"east": {"uv": [5, 5, 7, 13], "texture": "#side"},
|
||||
"south": {"uv": [4, 4, 12, 12], "texture": "#top", "cullface": "south"},
|
||||
"west": {"uv": [14, 4, 16, 12], "texture": "#side"},
|
||||
"up": {"uv": [12, 4, 14, 12], "rotation": 90, "texture": "#side"},
|
||||
"down": {"uv": [10, 1, 12, 10], "rotation": 90, "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [7, 10, 13],
|
||||
"to": [9, 10.5, 15],
|
||||
"rotation": {"angle": -45, "axis": "x", "origin": [8, 10.25, 14]},
|
||||
"faces": {
|
||||
"east": {"uv": [2, 5.5, 4, 6], "texture": "#top"},
|
||||
"west": {"uv": [12, 5.5, 14, 6], "texture": "#top"},
|
||||
"up": {"uv": [7, 13, 9, 15], "texture": "#top"},
|
||||
"down": {"uv": [7, 2, 9, 4], "texture": "#top"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [7, 5.5, 13],
|
||||
"to": [9, 6, 15],
|
||||
"rotation": {"angle": 45, "axis": "x", "origin": [8, 5.75, 14]},
|
||||
"faces": {
|
||||
"east": {"uv": [2, 5.5, 4, 6], "texture": "#top"},
|
||||
"west": {"uv": [12, 5.5, 14, 6], "texture": "#top"},
|
||||
"up": {"uv": [7, 12, 9, 14], "texture": "#top"},
|
||||
"down": {"uv": [7, 1, 9, 3], "texture": "#top"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [5.5, 7, 13],
|
||||
"to": [6, 9, 15],
|
||||
"rotation": {"angle": -45, "axis": "y", "origin": [5.75, 8, 14]},
|
||||
"faces": {
|
||||
"east": {"uv": [7, 12, 9, 14], "rotation": 270, "texture": "#top"},
|
||||
"west": {"uv": [7, 1, 9, 3], "rotation": 270, "texture": "#top"},
|
||||
"up": {"uv": [12, 5.5, 14, 6], "rotation": 90, "texture": "#top"},
|
||||
"down": {"uv": [2, 5.5, 4, 6], "rotation": 270, "texture": "#top"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [10, 7, 13],
|
||||
"to": [10.5, 9, 15],
|
||||
"rotation": {"angle": 45, "axis": "y", "origin": [10.25, 8, 14]},
|
||||
"faces": {
|
||||
"east": {"uv": [7, 13, 9, 15], "rotation": 270, "texture": "#top"},
|
||||
"west": {"uv": [7, 2, 9, 4], "rotation": 270, "texture": "#top"},
|
||||
"up": {"uv": [12, 5.5, 14, 6], "rotation": 90, "texture": "#top"},
|
||||
"down": {"uv": [2, 5.5, 4, 6], "rotation": 270, "texture": "#top"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"ground": {
|
||||
"scale": [0.2, 0.2, 0.2]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [30, 225, 0],
|
||||
"scale": [0.625, 0.625, 0.625]
|
||||
},
|
||||
"fixed": {
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"side": "engineersdecor:blocks/pole/thin_steel_pole_side_texture",
|
||||
"particle": "engineersdecor:blocks/pole/thin_steel_pole_side_texture",
|
||||
"top": "engineersdecor:blocks/pole/thin_steel_pole_top_texture"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [7, 9, 0],
|
||||
"to": [9, 10, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [7, 6, 9, 7], "texture": "#top"},
|
||||
"south": {"uv": [7, 6, 9, 7], "texture": "#top"},
|
||||
"up": {"uv": [7, 0, 9, 16], "texture": "#side"},
|
||||
"down": {"uv": [7, 0, 9, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [9, 6, 0],
|
||||
"to": [10, 10, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [6, 6, 7, 10], "texture": "#top", "cullface": "north"},
|
||||
"east": {"uv": [6, 0, 10, 16], "rotation": 90, "texture": "#side"},
|
||||
"south": {"uv": [9, 6, 10, 10], "texture": "#top", "cullface": "south"},
|
||||
"west": {"uv": [6, 0, 10, 16], "rotation": 90, "texture": "#side"},
|
||||
"up": {"uv": [9, 0, 10, 16], "texture": "#side"},
|
||||
"down": {"uv": [9, 0, 10, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [6, 6, 0],
|
||||
"to": [7, 10, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [9, 6, 10, 10], "texture": "#top", "cullface": "north"},
|
||||
"east": {"uv": [6, 0, 10, 16], "rotation": 90, "texture": "#side"},
|
||||
"south": {"uv": [6, 6, 7, 10], "texture": "#top", "cullface": "south"},
|
||||
"west": {"uv": [6, 0, 10, 16], "rotation": 90, "texture": "#side"},
|
||||
"up": {"uv": [6, 0, 7, 16], "texture": "#side"},
|
||||
"down": {"uv": [6, 0, 7, 16], "texture": "#side"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [7, 6, 0],
|
||||
"to": [9, 7, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [7, 9, 9, 10], "texture": "#top"},
|
||||
"south": {"uv": [7, 9, 9, 10], "texture": "#top"},
|
||||
"up": {"uv": [7, 0, 9, 16], "texture": "#side"},
|
||||
"down": {"uv": [7, 0, 9, 16], "texture": "#side"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"ground": {
|
||||
"scale": [0.2, 0.2, 0.2]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [30, 225, 0],
|
||||
"scale": [0.625, 0.625, 0.625]
|
||||
},
|
||||
"fixed": {
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"textures": { "all": "engineersdecor:blocks/clinker_brick/clinker_brick_texture0" }
|
||||
}
|
|
@ -2,8 +2,8 @@
|
|||
"parent": "block/block",
|
||||
"ambientocclusion": false,
|
||||
"textures": {
|
||||
"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall",
|
||||
"particle": "engineersdecor:blocks/clinker_brick/clinker_brick_wall",
|
||||
"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall0",
|
||||
"particle": "engineersdecor:blocks/clinker_brick/clinker_brick_wall0",
|
||||
"top": "engineersdecor:blocks/clinker_brick/clinker_brick_top"
|
||||
},
|
||||
"elements": [
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"credit": "I made this with the Blockbench",
|
||||
"textures": {
|
||||
"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall",
|
||||
"wall": "engineersdecor:blocks/clinker_brick/clinker_brick_wall0",
|
||||
"top": "engineersdecor:blocks/clinker_brick/clinker_brick_top",
|
||||
"particle": "engineersdecor:blocks/clinker_brick/clinker_brick_top"
|
||||
},
|
||||
|
@ -10,7 +10,7 @@
|
|||
"from": [4.125, 0, 0],
|
||||
"to": [11.875, 15.98, 8],
|
||||
"faces": {
|
||||
"north": {"texture": "#wall", "cullface": "north"},
|
||||
"north": {"texture": "#wall"},
|
||||
"east": {"texture": "#wall"},
|
||||
"west": {"texture": "#wall"},
|
||||
"up": {"texture": "#top"},
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
"credit": "I made this with the Blockbench",
|
||||
"textures": {
|
||||
"wall": "engineersdecor:blocks/concrete/rebar_concrete_texture0",
|
||||
"particle": "engineersdecor:blocks/concrete/rebar_concrete_texture0"
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
"credit": "I made this with the Blockbench",
|
||||
"textures": {
|
||||
"wall": "engineersdecor:blocks/concrete/rebar_concrete_texture0",
|
||||
"particle": "engineersdecor:blocks/concrete/rebar_concrete_texture0"
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
"parent": "block/block",
|
||||
"ambientocclusion": false,
|
||||
"textures": {
|
||||
"wall": "engineersdecor:blocks/slag_brick/slag_brick_wall",
|
||||
"particle": "engineersdecor:blocks/slag_brick/slag_brick_wall",
|
||||
"wall": "engineersdecor:blocks/slag_brick/slag_brick_wall0",
|
||||
"particle": "engineersdecor:blocks/slag_brick/slag_brick_wall0",
|
||||
"top": "engineersdecor:blocks/slag_brick/slag_brick_top"
|
||||
},
|
||||
"elements": [
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
"credit": "I made this with the Blockbench",
|
||||
"textures": {
|
||||
"postside": "engineersdecor:blocks/slag_brick/slag_brick_pole_side",
|
||||
"top": "engineersdecor:blocks/slag_brick/slag_brick_top",
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"credit": "I made this with the Blockbench",
|
||||
"textures": {
|
||||
"wall": "engineersdecor:blocks/slag_brick/slag_brick_wall",
|
||||
"wall": "engineersdecor:blocks/slag_brick/slag_brick_wall0",
|
||||
"top": "engineersdecor:blocks/slag_brick/slag_brick_top",
|
||||
"particle": "engineersdecor:blocks/slag_brick/slag_brick_top"
|
||||
},
|
||||
|
|
|
@ -19,10 +19,18 @@
|
|||
"ingredient": { "type": "forge:ore_dict", "ore": "ingotIron" },
|
||||
"name": "ingotIron"
|
||||
},
|
||||
{
|
||||
"ingredient": { "type": "forge:ore_dict", "ore": "blockIron" },
|
||||
"name": "blockIron"
|
||||
},
|
||||
{
|
||||
"ingredient": { "type": "forge:ore_dict", "ore": "plateIron" },
|
||||
"name": "plateIron"
|
||||
},
|
||||
{
|
||||
"ingredient": { "type": "forge:ore_dict", "ore": "ingotSteel" },
|
||||
"name": "ingotSteel"
|
||||
},
|
||||
{
|
||||
"ingredient": { "type": "forge:ore_dict", "ore": "plateSteel" },
|
||||
"name": "plateSteel"
|
||||
|
@ -47,6 +55,10 @@
|
|||
"ingredient": { "type": "forge:ore_dict", "ore": "plankWood" },
|
||||
"name": "plankWood"
|
||||
},
|
||||
{
|
||||
"ingredient": { "type": "forge:ore_dict", "ore": "slabWood" },
|
||||
"name": "slabWood"
|
||||
},
|
||||
{
|
||||
"ingredient": { "type": "forge:ore_dict", "ore": "stickWood" },
|
||||
"name": "stickWood"
|
||||
|
@ -94,6 +106,37 @@
|
|||
],
|
||||
"name": "plateAnyMetal"
|
||||
},
|
||||
{
|
||||
"conditions": [
|
||||
{ "type": "minecraft:item_exists", "item": "immersiveengineering:material" }
|
||||
],
|
||||
"ingredient": [
|
||||
{ "item": "immersiveengineering:material", "data": 8 },
|
||||
{ "item": "immersiveengineering:material", "data": 9 }
|
||||
],
|
||||
"name": "anyMechanicalComponent"
|
||||
},
|
||||
{
|
||||
"conditions": [
|
||||
{ "type": "minecraft:item_exists", "item": "immersiveengineering:connector" }
|
||||
],
|
||||
"ingredient": [
|
||||
{ "item": "immersiveengineering:connector", "data": 12 },
|
||||
{ "item": "immersiveengineering:connector", "data": 13 }
|
||||
],
|
||||
"name": "anyDirectedRedstoneConnector"
|
||||
},
|
||||
{
|
||||
"conditions": [
|
||||
{ "type": "minecraft:item_exists", "item": "immersiveengineering:connector" }
|
||||
],
|
||||
"ingredient": [
|
||||
{ "item": "immersiveengineering:connector", "data": 0 },
|
||||
{ "item": "immersiveengineering:connector", "data": 2 },
|
||||
{ "item": "immersiveengineering:connector", "data": 4 }
|
||||
],
|
||||
"name": "electricalConnector"
|
||||
},
|
||||
{
|
||||
"ingredient": [
|
||||
{ "type": "forge:ore_dict", "ore": "ingotBrick" },
|
||||
|
@ -117,6 +160,10 @@
|
|||
"ingredient": { "type": "forge:ore_dict", "ore": "blockGlass" },
|
||||
"name": "blockGlass"
|
||||
},
|
||||
{
|
||||
"ingredient": { "type": "forge:ore_dict", "ore": "dustRedstone" },
|
||||
"name": "dustRedstone"
|
||||
},
|
||||
{
|
||||
"ingredient": { "item": "minecraft:diamond", "data": 0 },
|
||||
"name": "itemDiamond"
|
||||
|
@ -150,6 +197,13 @@
|
|||
"ingredient": { "item": "immersiveengineering:wooden_device0", "data": 0 },
|
||||
"name": "crateTreatedWood"
|
||||
},
|
||||
{
|
||||
"conditions": [
|
||||
{ "type": "minecraft:item_exists", "item": "immersiveengineering:metal_device1" }
|
||||
],
|
||||
"ingredient": { "item": "immersiveengineering:metal_device1", "data": 6 },
|
||||
"name": "itemFluidPipe"
|
||||
},
|
||||
{
|
||||
"conditions": [
|
||||
{ "type": "engineersdecor:grc", "missing": ["immersiveengineering:stone_decoration"] }
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" ",
|
||||
"BBB",
|
||||
"BBB"
|
||||
],
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" ",
|
||||
"CCC",
|
||||
"CCC"
|
||||
],
|
|
@ -2,12 +2,12 @@
|
|||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:iron_inset_light"
|
||||
"result": "engineersdecor:iron_inset_light",
|
||||
"required": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" ",
|
||||
"GGG",
|
||||
"PLP"
|
||||
],
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"S S",
|
||||
"SSS",
|
||||
" "
|
||||
"SSS"
|
||||
],
|
||||
"key": {
|
||||
"S": {
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:passive_fluid_accumulator",
|
||||
"required": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"SPS",
|
||||
"PMP",
|
||||
"SPS"
|
||||
],
|
||||
"key": {
|
||||
"P": {
|
||||
"item": "#itemFluidPipe"
|
||||
},
|
||||
"M": {
|
||||
"item": "#anyMechanicalComponent"
|
||||
},
|
||||
"S": {
|
||||
"item": "#slabSheetmetalIron"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:passive_fluid_accumulator",
|
||||
"count": 1
|
||||
}
|
||||
}
|
|
@ -7,7 +7,6 @@
|
|||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" ",
|
||||
"CCC",
|
||||
"CCC"
|
||||
],
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" ",
|
||||
"BBB",
|
||||
"BBB"
|
||||
],
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:small_electrical_furnace",
|
||||
"required": ["immersiveengineering:material", "engineersdecor:small_lab_furnace"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" C ",
|
||||
"HFH"
|
||||
],
|
||||
"key": {
|
||||
"F": {
|
||||
"item": "engineersdecor:small_lab_furnace",
|
||||
"data": 0
|
||||
},
|
||||
"C": {
|
||||
"item": "#electricalConnector",
|
||||
"data": 0
|
||||
},
|
||||
"H": {
|
||||
"item": "#anyHopper",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:small_electrical_furnace",
|
||||
"count": 1
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:iron_inset_light",
|
||||
"missing": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"GGG",
|
||||
"PLP"
|
||||
],
|
||||
"key": {
|
||||
"P": {
|
||||
"item": "#ingotIron",
|
||||
"data": 0
|
||||
},
|
||||
"L": {
|
||||
"item": "#luminescentBlock",
|
||||
"data": 0
|
||||
},
|
||||
"G": {
|
||||
"item": "#paneGlass",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:iron_inset_light",
|
||||
"count": 8
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:metal_rung_ladder",
|
||||
"missing": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"S S",
|
||||
"SSS",
|
||||
" "
|
||||
],
|
||||
"key": {
|
||||
"S": {
|
||||
"item": "#ingotIron",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:metal_rung_ladder",
|
||||
"count": 4
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:metal_rung_steps",
|
||||
"missing": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" SS",
|
||||
"SS ",
|
||||
" SS"
|
||||
],
|
||||
"key": {
|
||||
"S": {
|
||||
"item": "#ingotIron",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:metal_rung_steps",
|
||||
"count": 4
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:panzerglass_block",
|
||||
"missing": ["immersiveengineering:stone_decoration"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"SGS",
|
||||
"GDG",
|
||||
"SGS"
|
||||
],
|
||||
"key": {
|
||||
"G": {
|
||||
"item": "#blockGlass",
|
||||
"data": 0
|
||||
},
|
||||
"S": {
|
||||
"item": "#ingotIron",
|
||||
"data": 0
|
||||
},
|
||||
"D": {
|
||||
"item": "#itemDiamond",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:panzerglass_block",
|
||||
"count": 8
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:steel_framed_window",
|
||||
"missing": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"WGW",
|
||||
"GGG",
|
||||
"WGW"
|
||||
],
|
||||
"key": {
|
||||
"W": {
|
||||
"item": "#ingotIron",
|
||||
"data": 0
|
||||
},
|
||||
"G": {
|
||||
"item": "#paneGlass",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:steel_framed_window",
|
||||
"count": 9
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:thin_steel_pole",
|
||||
"missing": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" S",
|
||||
" S ",
|
||||
"S "
|
||||
],
|
||||
"key": {
|
||||
"S": {
|
||||
"item": "#ingotIron",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:thin_steel_pole",
|
||||
"count": 12
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:treated_wood_ladder",
|
||||
"missing": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"LL",
|
||||
"LL",
|
||||
"LL"
|
||||
],
|
||||
"key": {
|
||||
"L": {
|
||||
"item": "minecraft:ladder",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:treated_wood_ladder",
|
||||
"count": 6
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:treated_wood_pole",
|
||||
"missing": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"S",
|
||||
"W",
|
||||
"W"
|
||||
],
|
||||
"key": {
|
||||
"W": {
|
||||
"item": "#plankWood",
|
||||
"data": 0
|
||||
},
|
||||
"S": {
|
||||
"item": "#slabWood",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:treated_wood_pole",
|
||||
"count": 6
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:treated_wood_stool",
|
||||
"missing": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"WWW",
|
||||
" S "
|
||||
],
|
||||
"key": {
|
||||
"W": {
|
||||
"item": "#slabWood",
|
||||
"data": 0
|
||||
},
|
||||
"S": {
|
||||
"item": "engineersdecor:treated_wood_pole",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:treated_wood_stool",
|
||||
"count": 1
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:treated_wood_table",
|
||||
"missing": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"WWW",
|
||||
"S S",
|
||||
"S S"
|
||||
],
|
||||
"key": {
|
||||
"W": {
|
||||
"item": "#slabWood",
|
||||
"data": 0
|
||||
},
|
||||
"S": {
|
||||
"item": "engineersdecor:treated_wood_pole",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:treated_wood_table",
|
||||
"count": 1
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:treated_wood_window",
|
||||
"missing": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"WGW",
|
||||
"GGG",
|
||||
"WGW"
|
||||
],
|
||||
"key": {
|
||||
"W": {
|
||||
"item": "#slabWood",
|
||||
"data": 0
|
||||
},
|
||||
"G": {
|
||||
"item": "#paneGlass",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:treated_wood_window",
|
||||
"count": 9
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"conditions": [
|
||||
{
|
||||
"type": "engineersdecor:grc",
|
||||
"result": "engineersdecor:treated_wood_windowsill",
|
||||
"missing": ["immersiveengineering:material"]
|
||||
}
|
||||
],
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"WWW",
|
||||
"S S"
|
||||
],
|
||||
"key": {
|
||||
"W": {
|
||||
"item": "#slabWood"
|
||||
},
|
||||
"S": {
|
||||
"item": "engineersdecor:treated_wood_pole"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "engineersdecor:treated_wood_windowsill",
|
||||
"count": 4
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue