Added check valve, double-T supports with auto-connections. Block/te registration adapted.
This commit is contained in:
parent
9217753469
commit
a6bdff4bde
27 changed files with 707 additions and 66 deletions
|
@ -1,15 +1,19 @@
|
|||
/*
|
||||
* @file BlockDecorDirected.java
|
||||
* @file BlockDecorHorizontalSupport.java
|
||||
* @author Stefan Wilhelm (wile)
|
||||
* @copyright (C) 2019 Stefan Wilhelm
|
||||
* @license MIT (see https://opensource.org/licenses/MIT)
|
||||
*
|
||||
* Smaller (cutout) block with a defined facing.
|
||||
* 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.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;
|
||||
|
@ -31,7 +35,10 @@ import java.util.Arrays;
|
|||
|
||||
public class BlockDecorHorizontalSupport extends BlockDecor
|
||||
{
|
||||
public static final PropertyBool EASTWEST = PropertyBool.create("eastwest");
|
||||
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)
|
||||
|
@ -39,10 +46,13 @@ public class BlockDecorHorizontalSupport extends BlockDecor
|
|||
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
|
||||
|
@ -66,6 +76,11 @@ public class BlockDecorHorizontalSupport extends BlockDecor
|
|||
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing face)
|
||||
{ return BlockFaceShape.UNDEFINED; }
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("deprecation")
|
||||
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos)
|
||||
{ return AABBs.get(state.getValue(EASTWEST) ? 0x3 : 0x2).offset(pos); }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
|
@ -78,15 +93,39 @@ public class BlockDecorHorizontalSupport extends BlockDecor
|
|||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{ return this.getDefaultState().withProperty(EASTWEST, ((meta & 0x1) != 0)); }
|
||||
{ return getDefaultState().withProperty(EASTWEST, ((meta & 0x1) != 0)); }
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{ return state.getValue(EASTWEST) ? 0x1 : 0x0; }
|
||||
{ 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); }
|
||||
{ return new BlockStateContainer(this, EASTWEST, RIGHTBEAM, LEFTBEAM, DOWNCONNECT); }
|
||||
|
||||
@Override
|
||||
public IBlockState withRotation(IBlockState state, Rotation rot)
|
||||
|
@ -104,9 +143,6 @@ public class BlockDecorHorizontalSupport extends BlockDecor
|
|||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
{
|
||||
facing = placer.getHorizontalFacing();
|
||||
return getDefaultState().withProperty(EASTWEST, (facing==EnumFacing.EAST)||(facing==EnumFacing.WEST));
|
||||
}
|
||||
{ return getActualState(getDefaultState().withProperty(EASTWEST, (placer.getHorizontalFacing().getAxis()==EnumFacing.Axis.X)), world, pos); }
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,198 @@
|
|||
/*
|
||||
* @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 net.minecraft.item.ItemStack;
|
||||
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.entity.EntityLivingBase;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
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 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
|
||||
@SuppressWarnings("deprecation")
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
{
|
||||
IBlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer);
|
||||
if(!placer.isSneaking()) state = state.withProperty(FACING, state.getValue(FACING).getOpposite());
|
||||
return state;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
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 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));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// Tile entity
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public static class BTileEntity extends TileEntity implements IFluidHandler, IFluidTankProperties, ICapabilityProvider
|
||||
{
|
||||
public static final int FLUID_CAPACITY_MB = 1000; // likely also the max flow per tick
|
||||
private static final BackFlowHandler back_flow_handler_ = new BackFlowHandler();
|
||||
private final IFluidTankProperties[] fluid_props_ = {this};
|
||||
private EnumFacing block_facing_ = EnumFacing.NORTH;
|
||||
private boolean filling = false;
|
||||
|
||||
public BTileEntity()
|
||||
{}
|
||||
|
||||
public void block_reconfigure(EnumFacing facing)
|
||||
{ block_facing_ = facing; }
|
||||
|
||||
// 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));
|
||||
}
|
||||
|
||||
// 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 ---------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public int fill(FluidStack resource, boolean doFill)
|
||||
{
|
||||
if(filling) return 0;
|
||||
final TileEntity te = world.getTileEntity(pos.offset(block_facing_));
|
||||
if(te == null) return 0;
|
||||
final IFluidHandler fh = te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, block_facing_.getOpposite());
|
||||
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.
|
||||
int n_filled = fh.fill(resource, doFill);
|
||||
filling = false;
|
||||
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 FLUID_CAPACITY_MB; }
|
||||
|
||||
@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; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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,6 +36,10 @@ import javax.annotation.Nonnull;
|
|||
@SuppressWarnings("unused")
|
||||
public class ModBlocks
|
||||
{
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
//-- Blocks
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public static final BlockDecorFull CLINKER_BRICK_BLOCK = new BlockDecorFull("clinker_brick_block", 0, Material.ROCK, 2f, 50f, 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);
|
||||
|
@ -176,9 +181,40 @@ public class ModBlocks
|
|||
ModAuxiliaries.getPixeledAABB(5,11,0, 11,16,16)
|
||||
);
|
||||
|
||||
public static final BlockDecorPipeValve STRAIGHT_PIPE_VALVE = new BlockDecorPipeValve(
|
||||
"straight_pipe_valve",
|
||||
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_FACING_PLACEMENT,
|
||||
Material.IRON, 1.0f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(4,4,0, 12,12,16)
|
||||
);
|
||||
|
||||
private static final Block modBlocks[] = {
|
||||
TREATED_WOOD_CRAFTING_TABLE,
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
//-- 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 STRAIGHT_PIPE_VALVE_TEI = new TileEntityRegistrationData(
|
||||
BlockDecorPipeValve.BTileEntity.class, "te_pipe_valve"
|
||||
);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
//-- 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,
|
||||
|
@ -201,7 +237,7 @@ 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,
|
||||
|
@ -210,13 +246,19 @@ public class ModBlocks
|
|||
THICK_STEEL_POLE,
|
||||
THIN_STEEL_POLE_HEAD,
|
||||
THICK_STEEL_POLE_HEAD,
|
||||
STEEL_DOUBLE_T_SUPPORT
|
||||
STEEL_DOUBLE_T_SUPPORT,
|
||||
STRAIGHT_PIPE_VALVE, STRAIGHT_PIPE_VALVE_TEI
|
||||
};
|
||||
|
||||
private static final Block devBlocks[] = {
|
||||
private static final Object dev_content[] = {
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
//-- Init
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
private static ArrayList<Block> registeredBlocks = new ArrayList<>();
|
||||
private static ArrayList<TileEntityRegistrationData> registeredTileEntityInits = new ArrayList<>();
|
||||
|
||||
@Nonnull
|
||||
public static List<Block> getRegisteredBlocks()
|
||||
|
@ -226,28 +268,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()
|
||||
|
|
|
@ -144,4 +144,6 @@ public class ModAuxiliaries
|
|||
}
|
||||
return bb;
|
||||
}
|
||||
|
||||
public interface IExperimentalFeature{}
|
||||
}
|
||||
|
|
|
@ -229,6 +229,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue