mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
Add and apply .editorconfig from P2 (#1195)
* Consistenty use javax annotations. - Unfortunately jetbrains annotations seem to be exposed transitively via core somewhere, but with the correct IDE settings, annotations can be defaulted to javax - Cleaning up of import order in #1195 - Must be merged before #1195 * Add and apply .editorconfig from P2 - Does not rearrange entries * Address some comments * add back some javadoc comments * Address final comments Co-authored-by: NotMyFault <mc.cache@web.de>
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.world.chunk;
|
||||
|
||||
import com.fastasyncworldedit.core.util.NbtUtils;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
@ -27,7 +28,6 @@ import com.sk89q.worldedit.util.nbt.BinaryTagTypes;
|
||||
import com.sk89q.worldedit.util.nbt.CompoundBinaryTag;
|
||||
import com.sk89q.worldedit.util.nbt.IntBinaryTag;
|
||||
import com.sk89q.worldedit.util.nbt.ListBinaryTag;
|
||||
import com.fastasyncworldedit.core.util.NbtUtils;
|
||||
import com.sk89q.worldedit.world.DataException;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
@ -35,9 +35,9 @@ import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
import com.sk89q.worldedit.world.storage.InvalidFormatException;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class AnvilChunk implements Chunk {
|
||||
|
||||
@ -54,6 +54,7 @@ public class AnvilChunk implements Chunk {
|
||||
|
||||
|
||||
//FAWE start
|
||||
|
||||
/**
|
||||
* Construct the chunk with a compound tag.
|
||||
*
|
||||
@ -102,14 +103,17 @@ public class AnvilChunk implements Chunk {
|
||||
}
|
||||
|
||||
blocks[y] = NbtUtils.getChildTag(sectionTag,
|
||||
"Blocks", BinaryTagTypes.BYTE_ARRAY).value();
|
||||
"Blocks", BinaryTagTypes.BYTE_ARRAY
|
||||
).value();
|
||||
data[y] = NbtUtils.getChildTag(sectionTag, "Data",
|
||||
BinaryTagTypes.BYTE_ARRAY).value();
|
||||
BinaryTagTypes.BYTE_ARRAY
|
||||
).value();
|
||||
|
||||
// 4096 ID block support
|
||||
if (sectionTag.get("Add") != null) {
|
||||
blocksAdd[y] = NbtUtils.getChildTag(sectionTag,
|
||||
"Add", BinaryTagTypes.BYTE_ARRAY).value();
|
||||
"Add", BinaryTagTypes.BYTE_ARRAY
|
||||
).value();
|
||||
}
|
||||
}
|
||||
|
||||
@ -263,9 +267,6 @@ public class AnvilChunk implements Chunk {
|
||||
}
|
||||
|
||||
CompoundBinaryTag values = tileEntities.get(position);
|
||||
if (values == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.world.chunk;
|
||||
|
||||
import com.fastasyncworldedit.core.util.NbtUtils;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
@ -27,7 +28,6 @@ import com.sk89q.worldedit.util.nbt.BinaryTagTypes;
|
||||
import com.sk89q.worldedit.util.nbt.CompoundBinaryTag;
|
||||
import com.sk89q.worldedit.util.nbt.IntBinaryTag;
|
||||
import com.sk89q.worldedit.util.nbt.ListBinaryTag;
|
||||
import com.fastasyncworldedit.core.util.NbtUtils;
|
||||
import com.sk89q.worldedit.world.DataException;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
@ -35,9 +35,9 @@ import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.world.storage.InvalidFormatException;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* The chunk format for Minecraft 1.13 to 1.15
|
||||
@ -55,6 +55,7 @@ public class AnvilChunk13 implements Chunk {
|
||||
|
||||
|
||||
//FAWE start
|
||||
|
||||
/**
|
||||
* Construct the chunk with a compound tag.
|
||||
*
|
||||
@ -122,7 +123,9 @@ public class AnvilChunk13 implements Chunk {
|
||||
try {
|
||||
blockState = getBlockStateWith(blockState, property, value);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new InvalidFormatException("Invalid block state for " + blockState.getBlockType().getId() + ", " + property.getName() + ": " + value);
|
||||
throw new InvalidFormatException("Invalid block state for " + blockState
|
||||
.getBlockType()
|
||||
.getId() + ", " + property.getName() + ": " + value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -141,7 +144,8 @@ public class AnvilChunk13 implements Chunk {
|
||||
}
|
||||
}
|
||||
|
||||
protected void readBlockStates(BlockState[] palette, long[] blockStatesSerialized, BlockState[] chunkSectionBlocks) throws InvalidFormatException {
|
||||
protected void readBlockStates(BlockState[] palette, long[] blockStatesSerialized, BlockState[] chunkSectionBlocks) throws
|
||||
InvalidFormatException {
|
||||
int paletteBits = 4;
|
||||
while ((1 << paletteBits) < palette.length) {
|
||||
++paletteBits;
|
||||
@ -224,9 +228,6 @@ public class AnvilChunk13 implements Chunk {
|
||||
}
|
||||
|
||||
CompoundBinaryTag values = tileEntities.get(position);
|
||||
if (values == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ import com.sk89q.worldedit.world.storage.InvalidFormatException;
|
||||
public class AnvilChunk16 extends AnvilChunk13 {
|
||||
|
||||
//FAWE start
|
||||
|
||||
/**
|
||||
* Construct the chunk with a compound tag.
|
||||
*
|
||||
@ -55,7 +56,8 @@ public class AnvilChunk16 extends AnvilChunk13 {
|
||||
//FAWE end
|
||||
|
||||
@Override
|
||||
protected void readBlockStates(BlockState[] palette, long[] blockStatesSerialized, BlockState[] chunkSectionBlocks) throws InvalidFormatException {
|
||||
protected void readBlockStates(BlockState[] palette, long[] blockStatesSerialized, BlockState[] chunkSectionBlocks) throws
|
||||
InvalidFormatException {
|
||||
PackedIntArrayReader reader = new PackedIntArrayReader(blockStatesSerialized);
|
||||
for (int blockPos = 0; blockPos < chunkSectionBlocks.length; blockPos++) {
|
||||
int index = reader.get(blockPos);
|
||||
@ -65,4 +67,5 @@ public class AnvilChunk16 extends AnvilChunk13 {
|
||||
chunkSectionBlocks[blockPos] = palette[index];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.world.chunk;
|
||||
|
||||
import com.fastasyncworldedit.core.util.NbtUtils;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
@ -27,7 +28,6 @@ import com.sk89q.worldedit.util.nbt.BinaryTagTypes;
|
||||
import com.sk89q.worldedit.util.nbt.CompoundBinaryTag;
|
||||
import com.sk89q.worldedit.util.nbt.IntBinaryTag;
|
||||
import com.sk89q.worldedit.util.nbt.ListBinaryTag;
|
||||
import com.fastasyncworldedit.core.util.NbtUtils;
|
||||
import com.sk89q.worldedit.world.DataException;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
@ -54,6 +54,7 @@ public class OldChunk implements Chunk {
|
||||
private Map<BlockVector3, CompoundBinaryTag> tileEntities;
|
||||
|
||||
//FAWE start
|
||||
|
||||
/**
|
||||
* Construct the chunk with a compound tag.
|
||||
*
|
||||
@ -162,9 +163,6 @@ public class OldChunk implements Chunk {
|
||||
}
|
||||
|
||||
CompoundBinaryTag values = tileEntities.get(position);
|
||||
if (values == null) {
|
||||
return null;
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@ package com.sk89q.worldedit.world.chunk;
|
||||
import static com.google.common.base.Preconditions.checkElementIndex;
|
||||
|
||||
public class PackedIntArrayReader {
|
||||
|
||||
private static final int[] FACTORS = new int[64];
|
||||
|
||||
static {
|
||||
|
Reference in New Issue
Block a user