3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-28 09:00:09 +01:00

Rename some A's

Dieser Commit ist enthalten in:
KennyTV 2020-06-27 16:56:57 +02:00
Ursprung 3a48e54e52
Commit 7a25645ed5
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
4 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -18,7 +18,7 @@ import java.util.regex.Pattern;
public class ChatRewriter { public class ChatRewriter {
private static final Pattern URL = Pattern.compile("^(?:(https?)://)?([-\\w_.]{2,}\\.[a-z]{2,4})(/\\S*)?$"); private static final Pattern URL = Pattern.compile("^(?:(https?)://)?([-\\w_.]{2,}\\.[a-z]{2,4})(/\\S*)?$");
private static final BaseComponent[] A = new BaseComponent[0]; private static final BaseComponent[] EMPTY_COMPONENTS = new BaseComponent[0];
private static final ComponentRewriter COMPONENT_REWRITER = new ComponentRewriter() { private static final ComponentRewriter COMPONENT_REWRITER = new ComponentRewriter() {
@Override @Override
protected void handleTranslate(JsonObject object, String translate) { protected void handleTranslate(JsonObject object, String translate) {
@ -128,7 +128,7 @@ public class ChatRewriter {
component.setText(builder.toString()); component.setText(builder.toString());
components.add(component); components.add(component);
final String serializedComponents = ComponentSerializer.toString(components.toArray(A)); final String serializedComponents = ComponentSerializer.toString(components.toArray(EMPTY_COMPONENTS));
return GsonUtil.getJsonParser().parse(serializedComponents); return GsonUtil.getJsonParser().parse(serializedComponents);
} }

Datei anzeigen

@ -29,7 +29,7 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
public class ConnectionData { public class ConnectionData {
private static final BlockChangeRecord[] A = new BlockChangeRecord[0]; private static final BlockChangeRecord[] EMPTY_RECORDS = new BlockChangeRecord[0];
public static BlockConnectionProvider blockConnectionProvider; public static BlockConnectionProvider blockConnectionProvider;
static Int2ObjectMap<String> idToKey = new Int2ObjectOpenHashMap<>(8582, 1F); static Int2ObjectMap<String> idToKey = new Int2ObjectOpenHashMap<>(8582, 1F);
static Map<String, Integer> keyToId = new HashMap<>(8582, 1F); static Map<String, Integer> keyToId = new HashMap<>(8582, 1F);
@ -121,7 +121,7 @@ public class ConnectionData {
PacketWrapper wrapper = new PacketWrapper(0x0F, null, user); PacketWrapper wrapper = new PacketWrapper(0x0F, null, user);
wrapper.write(Type.INT, chunkX + chunkDeltaX); wrapper.write(Type.INT, chunkX + chunkDeltaX);
wrapper.write(Type.INT, chunkZ + chunkDeltaZ); wrapper.write(Type.INT, chunkZ + chunkDeltaZ);
wrapper.write(Type.BLOCK_CHANGE_RECORD_ARRAY, updates.toArray(A)); wrapper.write(Type.BLOCK_CHANGE_RECORD_ARRAY, updates.toArray(EMPTY_RECORDS));
try { try {
wrapper.send(Protocol1_13To1_12_2.class, true, true); wrapper.send(Protocol1_13To1_12_2.class, true, true);
} catch (Exception e) { } catch (Exception e) {

Datei anzeigen

@ -17,7 +17,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
public class Chunk1_15Type extends PartialType<Chunk, ClientWorld> { public class Chunk1_15Type extends PartialType<Chunk, ClientWorld> {
private static final CompoundTag[] A = new CompoundTag[0]; private static final CompoundTag[] EMPTY_COMPOUNDS = new CompoundTag[0];
public Chunk1_15Type(ClientWorld param) { public Chunk1_15Type(ClientWorld param) {
super(param, Chunk.class); super(param, Chunk.class);
@ -98,7 +98,7 @@ public class Chunk1_15Type extends PartialType<Chunk, ClientWorld> {
} }
// Write Block Entities // Write Block Entities
Type.NBT_ARRAY.write(output, chunk.getBlockEntities().toArray(A)); Type.NBT_ARRAY.write(output, chunk.getBlockEntities().toArray(EMPTY_COMPOUNDS));
} }
@Override @Override

Datei anzeigen

@ -17,7 +17,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
public class Chunk1_16Type extends PartialType<Chunk, ClientWorld> { public class Chunk1_16Type extends PartialType<Chunk, ClientWorld> {
private static final CompoundTag[] A = new CompoundTag[0]; private static final CompoundTag[] EMPTY_COMPOUNDS = new CompoundTag[0];
public Chunk1_16Type(ClientWorld param) { public Chunk1_16Type(ClientWorld param) {
super(param, Chunk.class); super(param, Chunk.class);
@ -100,7 +100,7 @@ public class Chunk1_16Type extends PartialType<Chunk, ClientWorld> {
} }
// Write Block Entities // Write Block Entities
Type.NBT_ARRAY.write(output, chunk.getBlockEntities().toArray(A)); Type.NBT_ARRAY.write(output, chunk.getBlockEntities().toArray(EMPTY_COMPOUNDS));
} }
@Override @Override