mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-17 03:05:10 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
a314fccd1b
commit
8f026dad8f
161 files changed
+14073
-12846
No files matched your search
@@ -2,11 +2,6 @@ package team.chisel.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import team.chisel.client.render.RendererStairs;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -19,75 +14,81 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.client.render.RendererStairs;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
public class BlockCarvableStairs extends BlockStairs implements ICarvable {
|
||||
|
||||
CarvableHelper carverHelper;
|
||||
int blockMeta;
|
||||
CarvableHelper carverHelper;
|
||||
int blockMeta;
|
||||
|
||||
public BlockCarvableStairs(Block block, int meta, CarvableHelper helper) {
|
||||
super(block, meta);
|
||||
public BlockCarvableStairs(Block block, int meta, CarvableHelper helper) {
|
||||
super(block, meta);
|
||||
|
||||
this.useNeighborBrightness = true;
|
||||
carverHelper = helper;
|
||||
blockMeta = meta;
|
||||
}
|
||||
this.useNeighborBrightness = true;
|
||||
carverHelper = helper;
|
||||
blockMeta = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return carverHelper.getIcon(side, blockMeta + metadata / 8);
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return carverHelper.getIcon(side, blockMeta + metadata / 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i) {
|
||||
return i / 8;
|
||||
}
|
||||
@Override
|
||||
public int damageDropped(int i) {
|
||||
return i / 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
if (blockMeta == 0)
|
||||
carverHelper.registerBlockIcons("Chisel", this, register);
|
||||
}
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
if (blockMeta == 0) carverHelper.registerBlockIcons("Chisel", this, register);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void getSubBlocks(Item block, CreativeTabs tabs, List list) {
|
||||
list.add(new ItemStack(block, 1, 0));
|
||||
list.add(new ItemStack(block, 1, 8));
|
||||
}
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void getSubBlocks(Item block, CreativeTabs tabs, List list) {
|
||||
list.add(new ItemStack(block, 1, 0));
|
||||
list.add(new ItemStack(block, 1, 8));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return RendererStairs.id;
|
||||
}
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return RendererStairs.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) {
|
||||
int meta = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving,
|
||||
ItemStack par6ItemStack) {
|
||||
int meta = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
|
||||
// 0->2 2->3 3->0 1->1
|
||||
meta = meta == 0 ? 2 : meta == 2 ? 3 : meta == 3 ? 0 : 1;
|
||||
// 0->2 2->3 3->0 1->1
|
||||
meta = meta == 0 ? 2 : meta == 2 ? 3 : meta == 3 ? 0 : 1;
|
||||
|
||||
meta += par1World.getBlockMetadata(par2, par3, par4) % 8; // add upside-down-ness
|
||||
meta += par1World.getBlockMetadata(par2, par3, par4) % 8; // add upside-down-ness
|
||||
|
||||
if (par6ItemStack.getItemDamage() >= 8) {
|
||||
meta += 8;
|
||||
}
|
||||
if (par6ItemStack.getItemDamage() >= 8) {
|
||||
meta += 8;
|
||||
}
|
||||
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta, 2);
|
||||
}
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float hx, float hy, float hz, int damage) {
|
||||
return side != 0 && (side == 1 || hy <= 0.5D) ? damage : damage + 4;
|
||||
}
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float hx, float hy, float hz, int damage) {
|
||||
return side != 0 && (side == 1 || hy <= 0.5D) ? damage : damage + 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) {
|
||||
return carverHelper.getVariation(blockMeta + (metadata / 8));
|
||||
}
|
||||
@Override
|
||||
public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) {
|
||||
return carverHelper.getVariation(blockMeta + (metadata / 8));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IVariationInfo getManager(int meta) {
|
||||
return carverHelper.getVariation(blockMeta + (meta / 8));
|
||||
}
|
||||
@Override
|
||||
public IVariationInfo getManager(int meta) {
|
||||
return carverHelper.getVariation(blockMeta + (meta / 8));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user