mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-18 11:39:14 +00:00
humongous spotless apply to make CI happy
This commit is contained in:
1 parent
a0f11f404a
commit
834beb5ac8
114 files changed
+2121
-1858
No files matched your search
@@ -36,7 +36,7 @@ public class BlockAutoChisel extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float x1,
|
||||
float y1, float z1) {
|
||||
float y1, float z1) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (world.isRemote) return true;
|
||||
|
||||
|
||||
@@ -11,9 +11,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.config.Configurations;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
@@ -22,6 +19,8 @@ import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.config.Configurations;
|
||||
|
||||
public class BlockCarvable extends Block implements ICarvable {
|
||||
|
||||
@@ -145,7 +144,7 @@ public class BlockCarvable extends Block implements ICarvable {
|
||||
* @param frequency default 1.0f
|
||||
*/
|
||||
public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume,
|
||||
float frequency) {
|
||||
float frequency) {
|
||||
super(soundNameStep, volume, frequency);
|
||||
this.soundNameStep = soundNameStep;
|
||||
this.soundNameBreak = soundNameBreak;
|
||||
|
||||
@@ -13,14 +13,14 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.block.tileentity.TileEntityCarvableBeacon;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import team.chisel.block.tileentity.TileEntityCarvableBeacon;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
public class BlockCarvableBeacon extends BlockBeacon implements ICarvable {
|
||||
|
||||
public static int renderId;
|
||||
@@ -42,7 +42,7 @@ public class BlockCarvableBeacon extends BlockBeacon implements ICarvable {
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par5, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
float hitY, float hitZ) {
|
||||
if (world.isRemote) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -12,8 +12,6 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import team.chisel.ctmlib.CTM;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
@@ -22,6 +20,7 @@ import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.ctmlib.CTM;
|
||||
|
||||
public class BlockCarvableGlass extends BlockGlass implements ICarvable {
|
||||
|
||||
@@ -63,7 +62,8 @@ public class BlockCarvableGlass extends BlockGlass implements ICarvable {
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
ForgeDirection face = ForgeDirection.getOrientation(side).getOpposite();
|
||||
ForgeDirection face = ForgeDirection.getOrientation(side)
|
||||
.getOpposite();
|
||||
int meX = x + face.offsetX;
|
||||
int meY = y + face.offsetY;
|
||||
int meZ = z + face.offsetZ;
|
||||
|
||||
@@ -4,10 +4,10 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.client.render.SubmapManagerBase;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.client.render.SubmapManagerBase;
|
||||
|
||||
public class BlockCarvableGlow extends BlockCarvableColor {
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
public class BlockCarvableIceStairs extends BlockCarvableStairs {
|
||||
|
||||
public BlockCarvableIceStairs(Block block, int meta, CarvableHelper helper) {
|
||||
|
||||
@@ -4,9 +4,9 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
|
||||
public class BlockCarvableLayered extends BlockCarvable {
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
public class BlockCarvablePackedIceStairs extends BlockCarvableStairs {
|
||||
|
||||
public BlockCarvablePackedIceStairs(Block block, int meta, CarvableHelper helper) {
|
||||
|
||||
@@ -10,8 +10,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import team.chisel.client.render.RendererCTMPane;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
@@ -19,6 +17,7 @@ import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.client.render.RendererCTMPane;
|
||||
|
||||
public class BlockCarvablePane extends BlockPane implements ICarvable {
|
||||
|
||||
|
||||
@@ -10,15 +10,14 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.entity.EntityChiselSnowman;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.entity.EntityChiselSnowman;
|
||||
|
||||
public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
||||
|
||||
@@ -58,20 +57,20 @@ public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
||||
// Spawn some lovely particles
|
||||
for (int c = 0; c < 120; ++c) {
|
||||
world.spawnParticle(
|
||||
"snowshovel",
|
||||
x + world.rand.nextDouble(),
|
||||
y - 2 + world.rand.nextDouble() * 2.5D,
|
||||
z + world.rand.nextDouble(),
|
||||
0.0D,
|
||||
0.0D,
|
||||
0.0D);
|
||||
"snowshovel",
|
||||
x + world.rand.nextDouble(),
|
||||
y - 2 + world.rand.nextDouble() * 2.5D,
|
||||
z + world.rand.nextDouble(),
|
||||
0.0D,
|
||||
0.0D,
|
||||
0.0D);
|
||||
}
|
||||
} else
|
||||
if (world.getBlock(x, y - 1, z) == Blocks.iron_block || world.getBlock(x, y - 2, z) == Blocks.iron_block) {
|
||||
boolean flag = world.getBlock(x - 1, y - 1, z) == Blocks.iron_block
|
||||
&& world.getBlock(x + 1, y - 1, z) == Blocks.iron_block;
|
||||
&& world.getBlock(x + 1, y - 1, z) == Blocks.iron_block;
|
||||
boolean flag1 = world.getBlock(x, y - 1, z - 1) == Blocks.iron_block
|
||||
&& world.getBlock(x, y - 1, z + 1) == Blocks.iron_block;
|
||||
&& world.getBlock(x, y - 1, z + 1) == Blocks.iron_block;
|
||||
|
||||
if (flag || flag1) {
|
||||
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
||||
@@ -110,11 +109,10 @@ public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == 1 ? top
|
||||
: (side == 0 ? top
|
||||
: (meta == 2 && side == 2 ? face
|
||||
: (meta == 3 && side == 5 ? face
|
||||
: (meta == 0 && side == 3 ? face
|
||||
: (meta == 1 && side == 4 ? face : this.blockIcon)))));
|
||||
: (side == 0 ? top
|
||||
: (meta == 2 && side == 2 ? face
|
||||
: (meta == 3 && side == 5 ? face
|
||||
: (meta == 0 && side == 3 ? face : (meta == 1 && side == 4 ? face : this.blockIcon)))));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,8 +10,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
@@ -20,6 +18,7 @@ import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
|
||||
public class BlockCarvableSand extends BlockSand implements ICarvable {
|
||||
|
||||
@@ -133,7 +132,7 @@ public class BlockCarvableSand extends BlockSand implements ICarvable {
|
||||
* @param frequency default 1.0f
|
||||
*/
|
||||
public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume,
|
||||
float frequency) {
|
||||
float frequency) {
|
||||
super(soundNameStep, volume, frequency);
|
||||
this.soundNameStep = soundNameStep;
|
||||
this.soundNameBreak = soundNameBreak;
|
||||
|
||||
@@ -75,7 +75,7 @@ public class BlockCarvableSlab extends BlockCarvable {
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB,
|
||||
List par6List, Entity par7Entity) {
|
||||
List par6List, Entity par7Entity) {
|
||||
setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ 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;
|
||||
|
||||
import team.chisel.client.render.RendererStairs;
|
||||
|
||||
public class BlockCarvableStairs extends BlockStairs implements ICarvable {
|
||||
|
||||
CarvableHelper carverHelper;
|
||||
@@ -62,7 +62,7 @@ public class BlockCarvableStairs extends BlockStairs implements ICarvable {
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving,
|
||||
ItemStack par6ItemStack) {
|
||||
ItemStack par6ItemStack) {
|
||||
int meta = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
|
||||
// 0->2 2->3 3->0 1->1
|
||||
|
||||
@@ -7,8 +7,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
@@ -16,6 +14,7 @@ import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
|
||||
public class BlockCarvableTorch extends BlockTorch implements ICarvable {
|
||||
|
||||
@@ -57,7 +56,7 @@ public class BlockCarvableTorch extends BlockTorch implements ICarvable {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_,
|
||||
Random p_149734_5_) {
|
||||
Random p_149734_5_) {
|
||||
if (emitsParticles) {
|
||||
int l = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_);
|
||||
double d0 = p_149734_2_ + 0.5F;
|
||||
|
||||
@@ -10,9 +10,9 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.config.Configurations;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.config.Configurations;
|
||||
|
||||
public class BlockCloud extends BlockCarvable {
|
||||
|
||||
|
||||
@@ -7,19 +7,21 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovementInput;
|
||||
import net.minecraft.util.MovementInputFromOptions;
|
||||
|
||||
import team.chisel.config.Configurations;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.config.Configurations;
|
||||
|
||||
public class BlockConcrete extends BlockCarvable {
|
||||
|
||||
public BlockConcrete() {
|
||||
super();
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
FMLCommonHandler.instance()
|
||||
.bus()
|
||||
.register(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -29,16 +31,16 @@ public class BlockConcrete extends BlockCarvable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void speedupPlayer(PlayerTickEvent event) {
|
||||
if (event.phase == Phase.START && event.side.isClient()
|
||||
&& event.player.onGround
|
||||
&& event.player instanceof EntityPlayerSP) {
|
||||
&& event.player.onGround
|
||||
&& event.player instanceof EntityPlayerSP) {
|
||||
if (manualInputCheck == null) {
|
||||
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
||||
}
|
||||
EntityPlayerSP player = (EntityPlayerSP) event.player;
|
||||
Block below = player.worldObj.getBlock(
|
||||
MathHelper.floor_double(player.posX),
|
||||
MathHelper.floor_double(player.posY) - 2,
|
||||
MathHelper.floor_double(player.posZ));
|
||||
MathHelper.floor_double(player.posX),
|
||||
MathHelper.floor_double(player.posY) - 2,
|
||||
MathHelper.floor_double(player.posZ));
|
||||
if (below == this) {
|
||||
manualInputCheck.updatePlayerMoveState();
|
||||
if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) {
|
||||
|
||||
@@ -19,15 +19,14 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.block.tileentity.TileEntityPresent;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.block.tileentity.TileEntityPresent;
|
||||
|
||||
public class BlockPresent extends Block implements ICarvable {
|
||||
|
||||
@@ -110,7 +109,7 @@ public class BlockPresent extends Block implements ICarvable {
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int hitX, float hitY,
|
||||
float hitZ, float p_149727_9_) {
|
||||
float hitZ, float p_149727_9_) {
|
||||
if (!world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN)) {
|
||||
if (!world.isRemote) {
|
||||
player.openGui(Chisel.instance, 2, world, x, y, z);
|
||||
@@ -143,22 +142,22 @@ public class BlockPresent extends Block implements ICarvable {
|
||||
ForgeDirection dir = me.getConnectionDir();
|
||||
// warning: magic below! Do not change this conditional
|
||||
if (dir == ForgeDirection.EAST || (me.isParent() && dir == ForgeDirection.SOUTH)
|
||||
|| (!me.isParent() && dir == ForgeDirection.SOUTH)) {
|
||||
|| (!me.isParent() && dir == ForgeDirection.SOUTH)) {
|
||||
return AxisAlignedBB.getBoundingBox(
|
||||
x + minX,
|
||||
y + minY,
|
||||
z + minZ,
|
||||
x + maxX + dir.offsetX,
|
||||
y + maxY,
|
||||
z + maxZ + dir.offsetZ);
|
||||
x + minX,
|
||||
y + minY,
|
||||
z + minZ,
|
||||
x + maxX + dir.offsetX,
|
||||
y + maxY,
|
||||
z + maxZ + dir.offsetZ);
|
||||
} else {
|
||||
return AxisAlignedBB.getBoundingBox(
|
||||
x + dir.offsetX + minX,
|
||||
y + minY,
|
||||
z + dir.offsetZ + minZ,
|
||||
x + maxX,
|
||||
y + maxY,
|
||||
z + maxZ);
|
||||
x + dir.offsetX + minX,
|
||||
y + minY,
|
||||
z + dir.offsetZ + minZ,
|
||||
x + maxX,
|
||||
y + maxY,
|
||||
z + maxZ);
|
||||
}
|
||||
}
|
||||
return AxisAlignedBB.getBoundingBox(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ);
|
||||
|
||||
@@ -9,10 +9,10 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.config.Configurations;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.config.Configurations;
|
||||
|
||||
public class BlockRoadLine extends BlockCarvable {
|
||||
|
||||
@@ -53,7 +53,8 @@ public class BlockRoadLine extends BlockCarvable {
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
||||
return World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4)
|
||||
|| par1World.getBlock(par2, par3 - 1, par4).equals(Blocks.glowstone);
|
||||
|| par1World.getBlock(par2, par3 - 1, par4)
|
||||
.equals(Blocks.glowstone);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -134,7 +134,8 @@ public class BlockSnakestone extends Block {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!world.getBlock(x, y, z).equals(this)) continue;
|
||||
if (!world.getBlock(x, y, z)
|
||||
.equals(this)) continue;
|
||||
boolean match = false;
|
||||
|
||||
int px1 = x, px2 = x;
|
||||
@@ -250,17 +251,23 @@ public class BlockSnakestone extends Block {
|
||||
public boolean connectedTo(World par1World, int x, int y, int z, int direction) {
|
||||
switch (direction) {
|
||||
case 0:
|
||||
return par1World.getBlock(x, y, z - 1).equals(this);
|
||||
return par1World.getBlock(x, y, z - 1)
|
||||
.equals(this);
|
||||
case 1:
|
||||
return par1World.getBlock(x, y, z + 1).equals(this);
|
||||
return par1World.getBlock(x, y, z + 1)
|
||||
.equals(this);
|
||||
case 2:
|
||||
return par1World.getBlock(x - 1, y, z).equals(this);
|
||||
return par1World.getBlock(x - 1, y, z)
|
||||
.equals(this);
|
||||
case 3:
|
||||
return par1World.getBlock(x + 1, y, z).equals(this);
|
||||
return par1World.getBlock(x + 1, y, z)
|
||||
.equals(this);
|
||||
case 4:
|
||||
return par1World.getBlock(x, y - 1, z).equals(this);
|
||||
return par1World.getBlock(x, y - 1, z)
|
||||
.equals(this);
|
||||
case 5:
|
||||
return par1World.getBlock(x, y + 1, z).equals(this);
|
||||
return par1World.getBlock(x, y + 1, z)
|
||||
.equals(this);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -3,13 +3,13 @@ package team.chisel.block;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.item.ItemCarvable;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.item.ItemCarvable;
|
||||
|
||||
public class CarvableStairsMaker {
|
||||
|
||||
@@ -29,20 +29,21 @@ public class CarvableStairsMaker {
|
||||
for (int i = 0; i < blocks.length; i++) {
|
||||
String n = name + "." + i;
|
||||
blocks[i] = creator == null ? new BlockCarvableStairs(blockBase, i * 2, carverHelper)
|
||||
: creator.create(blockBase, i * 2, carverHelper);
|
||||
: creator.create(blockBase, i * 2, carverHelper);
|
||||
|
||||
blocks[i].setBlockName("chisel." + n).setCreativeTab(ChiselTabs.tabStairChiselBlocks);
|
||||
blocks[i].setBlockName("chisel." + n)
|
||||
.setCreativeTab(ChiselTabs.tabStairChiselBlocks);
|
||||
GameRegistry.registerBlock(blocks[i], ItemCarvable.class, n);
|
||||
|
||||
for (int meta = 0; meta < 2 && i * 2 + meta < carverHelper.infoList.size(); meta++) {
|
||||
Carving.chisel.addVariation(name, CarvingUtils.getDefaultVariationFor(blocks[i], meta * 8, i));
|
||||
GameRegistry.addRecipe(
|
||||
new ItemStack(blocks[i], 4, meta * 8),
|
||||
"* ",
|
||||
"** ",
|
||||
"***",
|
||||
'*',
|
||||
new ItemStack(blockBase, 1, i * 2 + meta));
|
||||
new ItemStack(blocks[i], 4, meta * 8),
|
||||
"* ",
|
||||
"** ",
|
||||
"***",
|
||||
'*',
|
||||
new ItemStack(blockBase, 1, i * 2 + meta));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Features;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.client.GeneralChiselClient;
|
||||
@@ -24,11 +28,6 @@ import team.chisel.network.message.MessageAutoChisel;
|
||||
import team.chisel.network.message.MessageSlotUpdate;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TileEntityAutoChisel extends TileEntity implements ISidedInventory {
|
||||
|
||||
public enum Upgrade {
|
||||
@@ -40,15 +39,19 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
|
||||
public String getUnlocalizedName() {
|
||||
if (Features.AUTO_CHISEL_UPGRADES.enabled()) {
|
||||
return "item.upgrade_" + this.name().toLowerCase();
|
||||
return "item.upgrade_" + this.name()
|
||||
.toLowerCase();
|
||||
}
|
||||
return "chisel.autochisel.upgrade.disabled";
|
||||
}
|
||||
|
||||
public String getLocalizedName() {
|
||||
String ret = StatCollector.translateToLocal("autochisel.slot." + this.name().toLowerCase() + ".tooltip");
|
||||
String ret = StatCollector.translateToLocal(
|
||||
"autochisel.slot." + this.name()
|
||||
.toLowerCase() + ".tooltip");
|
||||
if (!Features.AUTO_CHISEL_UPGRADES.enabled()) {
|
||||
ret = EnumChatFormatting.RED.toString().concat(ret);
|
||||
ret = EnumChatFormatting.RED.toString()
|
||||
.concat(ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -227,12 +230,12 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
}
|
||||
|
||||
return ((IChiselItem) inventory[CHISEL].getItem())
|
||||
.canChisel(worldObj, inventory[CHISEL], General.getVariation(getTarget()));
|
||||
.canChisel(worldObj, inventory[CHISEL], General.getVariation(getTarget()));
|
||||
}
|
||||
|
||||
private boolean hasChisel() {
|
||||
return inventory[CHISEL] != null && inventory[CHISEL].getItem() instanceof IChiselItem
|
||||
&& inventory[CHISEL].stackSize >= 1;
|
||||
&& inventory[CHISEL].stackSize >= 1;
|
||||
}
|
||||
|
||||
/** Calls IChiselItem#onChisel() and sends the chisel packet for sound/animation */
|
||||
@@ -240,7 +243,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
if (!worldObj.isRemote) {
|
||||
boolean breakChisel = false;
|
||||
if (((IChiselItem) inventory[CHISEL].getItem())
|
||||
.onChisel(worldObj, inventory[CHISEL], General.getVariation(target))) {
|
||||
.onChisel(worldObj, inventory[CHISEL], General.getVariation(target))) {
|
||||
inventory[CHISEL].setItemDamage(inventory[CHISEL].getItemDamage() + 1);
|
||||
if (inventory[CHISEL].getItemDamage() >= inventory[CHISEL].getMaxDamage()) {
|
||||
setInventorySlotContents(CHISEL, null);
|
||||
@@ -248,18 +251,18 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
}
|
||||
}
|
||||
PacketHandler.INSTANCE.sendToDimension(
|
||||
new MessageAutoChisel(this, chiseled, true, breakChisel),
|
||||
worldObj.provider.dimensionId);
|
||||
new MessageAutoChisel(this, chiseled, true, breakChisel),
|
||||
worldObj.provider.dimensionId);
|
||||
} else {
|
||||
if (breakChisel) {
|
||||
worldObj.playSound(
|
||||
xCoord + 0.5,
|
||||
yCoord + 0.5,
|
||||
zCoord + 0.5,
|
||||
"random.break",
|
||||
0.8F,
|
||||
0.8F + worldObj.rand.nextFloat() * 0.4F,
|
||||
false);
|
||||
xCoord + 0.5,
|
||||
yCoord + 0.5,
|
||||
zCoord + 0.5,
|
||||
"random.break",
|
||||
0.8F,
|
||||
0.8F + worldObj.rand.nextFloat() * 0.4F,
|
||||
false);
|
||||
}
|
||||
GeneralChiselClient.spawnAutoChiselFX(this, lastBase != null ? lastBase : inventory[BASE]);
|
||||
chiseling = false;
|
||||
@@ -331,7 +334,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
|
||||
private void slotChanged(int slot) {
|
||||
PacketHandler.INSTANCE
|
||||
.sendToDimension(new MessageSlotUpdate(this, slot, inventory[slot]), worldObj.provider.dimensionId);
|
||||
.sendToDimension(new MessageSlotUpdate(this, slot, inventory[slot]), worldObj.provider.dimensionId);
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@@ -369,14 +372,15 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
switch (slot) {
|
||||
case BASE:
|
||||
case TARGET:
|
||||
return !Carving.chisel.getItemsForChiseling(itemStack).isEmpty();
|
||||
return !Carving.chisel.getItemsForChiseling(itemStack)
|
||||
.isEmpty();
|
||||
case OUTPUT:
|
||||
return false;
|
||||
case CHISEL:
|
||||
return itemStack.getItem() instanceof IChiselItem;
|
||||
default:
|
||||
return Features.AUTO_CHISEL_UPGRADES.enabled() && itemStack.getItem() == ChiselItems.upgrade
|
||||
&& Upgrade.values()[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage();
|
||||
&& Upgrade.values()[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
|
||||
private boolean connectTo(TileEntityPresent present, ForgeDirection dir) {
|
||||
if (present.getBlockMetadata() == getBlockMetadata() && !present.isConnected()
|
||||
&& (present.cachedDir == null || present.cachedDir == dir.getOpposite())
|
||||
&& Math.abs(present.xCoord - xCoord + present.yCoord - yCoord + present.zCoord - zCoord) == 1) {
|
||||
&& (present.cachedDir == null || present.cachedDir == dir.getOpposite())
|
||||
&& Math.abs(present.xCoord - xCoord + present.yCoord - yCoord + present.zCoord - zCoord) == 1) {
|
||||
connection = present;
|
||||
connection.connection = this;
|
||||
connection.cachedDir = dir.getOpposite();
|
||||
@@ -57,7 +57,7 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
isParent = !present.isParent;
|
||||
markDirty();
|
||||
PacketHandler.INSTANCE
|
||||
.sendToDimension(new MessagePresentConnect(this, dir, true), worldObj.provider.dimensionId);
|
||||
.sendToDimension(new MessagePresentConnect(this, dir, true), worldObj.provider.dimensionId);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -87,8 +87,8 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
this.connection = null;
|
||||
this.markDirty();
|
||||
PacketHandler.INSTANCE.sendToDimension(
|
||||
new MessagePresentConnect(this, ForgeDirection.UNKNOWN, false, preserveDir),
|
||||
worldObj.provider.dimensionId);
|
||||
new MessagePresentConnect(this, ForgeDirection.UNKNOWN, false, preserveDir),
|
||||
worldObj.provider.dimensionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y,
|
||||
int z) {
|
||||
int z) {
|
||||
// prevent losing TE data when in-world chiseling
|
||||
return oldBlock != newBlock;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user