Recipe tuning. Stairs extended tooltip added. Tooltip documentation updated. Light opacity tuning. Panzer glass ambient occlusion tuning. Unused pole texture regions filled (optifine rendering). Brick wall cullfacing removed. Window models using mipped-cutout instead of cutout (issue #19).
This commit is contained in:
parent
af228ac730
commit
9217753469
59 changed files with 653 additions and 49 deletions
|
@ -50,7 +50,7 @@ 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)
|
||||
|
@ -59,7 +59,7 @@ public class BlockDecorGlassBlock extends BlockDecor
|
|||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{ return false; }
|
||||
{ return true; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -68,7 +68,7 @@ public class BlockDecorGlassBlock extends BlockDecor
|
|||
|
||||
@Override
|
||||
public int getLightOpacity(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{ return 0; }
|
||||
{ return 2; }
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
* @file BlockDecorDirected.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.
|
||||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
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");
|
||||
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(
|
||||
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
|
||||
@SuppressWarnings("deprecation")
|
||||
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(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 this.getDefaultState().withProperty(EASTWEST, ((meta & 0x1) != 0)); }
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{ return state.getValue(EASTWEST) ? 0x1 : 0x0; }
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{ return new BlockStateContainer(this, EASTWEST); }
|
||||
|
||||
@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
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side)
|
||||
{ return super.canPlaceBlockOnSide(world, pos, side); }
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
}
|
|
@ -8,9 +8,21 @@
|
|||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import net.minecraft.block.material.EnumPushReaction;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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
|
||||
|
@ -21,10 +33,49 @@ public class BlockDecorStairs extends net.minecraft.block.BlockStairs
|
|||
setCreativeTab(ModEngineersDecor.CREATIVE_TAB_ENGINEERSDECOR);
|
||||
setRegistryName(ModEngineersDecor.MODID, registryName);
|
||||
setTranslationKey(ModEngineersDecor.MODID + "." + registryName);
|
||||
setLightLevel(0);
|
||||
setLightOpacity(64);
|
||||
}
|
||||
|
||||
@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 int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{ return 0; }
|
||||
|
||||
@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; }
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -169,6 +169,14 @@ public class ModBlocks
|
|||
ModAuxiliaries.getPixeledAABB(0,0,15.6, 16,16,16.0)
|
||||
);
|
||||
|
||||
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, 1.0f, 15f, SoundType.METAL,
|
||||
ModAuxiliaries.getPixeledAABB(5,11,0, 11,16,16)
|
||||
);
|
||||
|
||||
|
||||
private static final Block modBlocks[] = {
|
||||
TREATED_WOOD_CRAFTING_TABLE,
|
||||
CLINKER_BRICK_BLOCK,
|
||||
|
@ -201,7 +209,8 @@ public class ModBlocks
|
|||
THIN_STEEL_POLE,
|
||||
THICK_STEEL_POLE,
|
||||
THIN_STEEL_POLE_HEAD,
|
||||
THICK_STEEL_POLE_HEAD
|
||||
THICK_STEEL_POLE_HEAD,
|
||||
STEEL_DOUBLE_T_SUPPORT
|
||||
};
|
||||
|
||||
private static final Block devBlocks[] = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue