Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
PetteriM1 committed Mar 26, 2024
1 parent 36dd01d commit 003debb
Show file tree
Hide file tree
Showing 19 changed files with 20 additions and 24 deletions.
8 changes: 2 additions & 6 deletions src/main/java/cn/nukkit/Nukkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public static void main(String[] args) {
OptionSpec<String> vSpec = parser.accepts("v", "Set verbosity of logging").withRequiredArg().ofType(String.class);
OptionSpec<String> verbositySpec = parser.accepts("verbosity", "Set verbosity of logging").withRequiredArg().ofType(String.class);
OptionSpec<String> languageSpec = parser.accepts("language", "Set a predefined language").withOptionalArg().ofType(String.class);
OptionSpec<Void> nettyDebugSpec = parser.accepts("debug", "Enables debug stuff");

// Parse arguments
OptionSet options = parser.parse(args);
Expand All @@ -87,11 +86,8 @@ public static void main(String[] args) {
return;
}

// Netty logger for debug info
if (options.has(nettyDebugSpec)) {
InternalLoggerFactory.setDefaultFactory(Log4J2LoggerFactory.INSTANCE);
ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.PARANOID);
}
InternalLoggerFactory.setDefaultFactory(Log4J2LoggerFactory.INSTANCE);
ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.PARANOID);

TITLE = options.has(titleSpec);

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/Block.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public abstract class Block extends Position implements Metadatable, Cloneable,
/**
* A commonly used block face pattern
*/
protected static final int[] faces2534 = {2, 5, 3, 4};
protected static final int[] FACES2534 = {2, 5, 3, 4};

protected Block() {}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockAnvil.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
public class BlockAnvil extends BlockFallableMeta implements Faceable {

private static final int[] faces = {1, 2, 3, 0};
private static final int[] FACES = {1, 2, 3, 0};

private static final String[] NAMES = {
"Anvil",
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockBlastFurnaceLit.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Item toItem() {

@Override
public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) {
this.setDamage(Block.faces2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
this.setDamage(Block.FACES2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
this.getLevel().setBlock(block, this, true, true);
CompoundTag nbt = new CompoundTag()
.putList(new ListTag<>("Items"))
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockBone.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public class BlockBone extends BlockSolid implements Faceable {

private static final int[] faces = {
private static final int[] FACES = {
0,
0,
0b1000,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public double getMaxZ() {
@Override
public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) {
BlockEntityChest chest = null;
this.setDamage(Block.faces2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
this.setDamage(Block.FACES2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);

for (int side = 2; side <= 5; ++side) {
if ((this.getDamage() == 4 || this.getDamage() == 5) && (side == 4 || side == 5)) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockDoor.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public abstract class BlockDoor extends BlockTransparentMeta implements Faceable
public static final int DOOR_HINGE_BIT = 0x01;
public static final int DOOR_POWERED_BIT = 0x02;

private static final int[] faces = {1, 2, 3, 0};
private static final int[] FACES = {1, 2, 3, 0};

protected BlockDoor(int meta) {
super(meta);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockEndPortalFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public class BlockEndPortalFrame extends BlockTransparentMeta implements Faceable {

private static final int[] faces = {2, 3, 0, 1};
private static final int[] FACES = {2, 3, 0, 1};

public BlockEndPortalFrame() {
this(0);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockEndRod.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
public class BlockEndRod extends BlockTransparentMeta implements Faceable {

private static final int[] faces = {0, 1, 3, 2, 5, 4};
private static final int[] FACES = {0, 1, 3, 2, 5, 4};

public BlockEndRod() {
this(0);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockEnderChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public double getMaxZ() {

@Override
public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) {
this.setDamage(Block.faces2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
this.setDamage(Block.FACES2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);

this.getLevel().setBlock(this, this, true, true);

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockFurnaceBurning.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public int getLightLevel() {

@Override
public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) {
this.setDamage(Block.faces2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
this.setDamage(Block.FACES2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
this.getLevel().setBlock(block, this, true, true);
CompoundTag nbt = new CompoundTag()
.putList(new ListTag<>("Items"))
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockLadder.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
public class BlockLadder extends BlockTransparentMeta implements Faceable {

private static final int[] faces = {
private static final int[] FACES = {
0, //never use
1, //never use
3,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockLightningRod.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class BlockLightningRod extends BlockTransparentMeta {

private static final int[] faces = {0, 1, 2, 3, 4, 5};
private static final int[] FACES = {0, 1, 2, 3, 4, 5};

public BlockLightningRod() {
this(0);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockSmokerLit.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Item toItem() {

@Override
public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) {
this.setDamage(Block.faces2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
this.setDamage(Block.FACES2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
this.getLevel().setBlock(block, this, true, true);
CompoundTag nbt = new CompoundTag()
.putList(new ListTag<>("Items"))
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockStonecutterBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public double getMaxY() {

@Override
public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) {
this.setDamage(Block.faces2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
this.setDamage(Block.FACES2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
return super.place(item, block, target, face, fx, fy, fz, player);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockTerracottaGlazed.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public Item[] getDrops(Item item) {

@Override
public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) {
this.setDamage(Block.faces2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
this.setDamage(Block.FACES2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
return this.getLevel().setBlock(block, this, true, true);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockTrapdoor.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class BlockTrapdoor extends BlockTransparentMeta implements Faceable {
public static final int TRAPDOOR_OPEN_BIT = 0x08;
public static final int TRAPDOOR_TOP_BIT = 0x04;

private static final int[] faces = {2, 1, 3, 0};
private static final int[] FACES = {2, 1, 3, 0};

public BlockTrapdoor() {
this(0);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockTrappedChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public String getName() {
@Override
public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) {
BlockEntityChest chest = null;
this.setDamage(Block.faces2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);
this.setDamage(Block.FACES2534[player != null ? player.getDirection().getHorizontalIndex() : 0]);

for (BlockFace side : Plane.HORIZONTAL) {
if ((this.getDamage() == 4 || this.getDamage() == 5) && (side == BlockFace.WEST || side == BlockFace.EAST)) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockWallSign.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
public class BlockWallSign extends BlockSignPost {

private static final int[] faces = {
private static final int[] FACES = {
3,
2,
5,
Expand Down

0 comments on commit 003debb

Please sign in to comment.