[ci skip] spotlessApply with the new settings

This commit is contained in:
Jason Mitchell committed 2023-01-29 10:09:28 -08:00
1 parent a314fccd1b
commit 8f026dad8f
161 files changed
+14073 -12846

No files matched your search

@@ -11,71 +11,70 @@ import net.minecraft.world.World;
public class BlockCarvableLamp extends BlockCarvable {
BlockCarvableLamp blockUnpowered;
BlockCarvableLamp blockPowered;
boolean powered;
BlockCarvableLamp blockUnpowered;
BlockCarvableLamp blockPowered;
boolean powered;
public BlockCarvableLamp() {
super(Material.redstoneLight);
public BlockCarvableLamp() {
super(Material.redstoneLight);
powered = false;
blockUnpowered = this;
blockPowered = new BlockCarvableLamp(this);
powered = false;
blockUnpowered = this;
blockPowered = new BlockCarvableLamp(this);
setHardness(0.3F);
}
setHardness(0.3F);
}
public BlockCarvableLamp(BlockCarvableLamp unpoweredVersion) {
super(Material.redstoneLight);
public BlockCarvableLamp(BlockCarvableLamp unpoweredVersion) {
super(Material.redstoneLight);
carverHelper = unpoweredVersion.carverHelper;
carverHelper = unpoweredVersion.carverHelper;
powered = true;
blockUnpowered = unpoweredVersion;
blockPowered = this;
powered = true;
blockUnpowered = unpoweredVersion;
blockPowered = this;
setLightLevel(1.0F);
setHardness(0.3F);
}
setLightLevel(1.0F);
setHardness(0.3F);
}
public void checkPower(World world, int x, int y, int z) {
if (world.isRemote)
return;
public void checkPower(World world, int x, int y, int z) {
if (world.isRemote) return;
boolean isGettingPower = world.isBlockIndirectlyGettingPowered(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
boolean isGettingPower = world.isBlockIndirectlyGettingPowered(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
if (powered && !isGettingPower) {
world.setBlock(x, y, z, blockUnpowered, meta, 2);
} else if (!powered && isGettingPower) {
world.setBlock(x, y, z, blockPowered, meta, 2);
}
}
if (powered && !isGettingPower) {
world.setBlock(x, y, z, blockUnpowered, meta, 2);
} else if (!powered && isGettingPower) {
world.setBlock(x, y, z, blockPowered, meta, 2);
}
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
checkPower(world, x, y, z);
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
checkPower(world, x, y, z);
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
checkPower(world, x, y, z);
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
checkPower(world, x, y, z);
}
/*
* @Override public void updateTick(World world, int x, int y, int z, Random rand){ if (world.isRemote) return;
*
* if(powered && !world.isBlockIndirectlyGettingPowered(x, y, z)){ int meta=world.getBlockMetadata(x, y, z); world.setBlock(x, y, z, Block.redstoneLampIdle.blockID, meta, 2); } }
*/
/*
* @Override public void updateTick(World world, int x, int y, int z, Random rand){ if (world.isRemote) return;
* if(powered && !world.isBlockIndirectlyGettingPowered(x, y, z)){ int meta=world.getBlockMetadata(x, y, z);
* world.setBlock(x, y, z, Block.redstoneLampIdle.blockID, meta, 2); } }
*/
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
return Item.getItemFromBlock(blockUnpowered);
}
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
return Item.getItemFromBlock(blockUnpowered);
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
return new ItemStack(blockUnpowered, 1, world.getBlockMetadata(x, y, z));
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
return new ItemStack(blockUnpowered, 1, world.getBlockMetadata(x, y, z));
}
}