Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-27 03:12:37 +01:00
Remove usages of JoinedCharSequence (#2062)
Dieser Commit ist enthalten in:
Ursprung
452f968f07
Commit
bb0e201c52
@ -1,5 +1,9 @@
|
|||||||
package com.fastasyncworldedit.core.util;
|
package com.fastasyncworldedit.core.util;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Unused, will be removed in the future. Use String concatenation instead.
|
||||||
|
*/
|
||||||
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
public class JoinedCharSequence implements CharSequence {
|
public class JoinedCharSequence implements CharSequence {
|
||||||
|
|
||||||
private char join;
|
private char join;
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
package com.sk89q.worldedit.world.block;
|
package com.sk89q.worldedit.world.block;
|
||||||
|
|
||||||
import com.fastasyncworldedit.core.command.SuggestInputParseException;
|
import com.fastasyncworldedit.core.command.SuggestInputParseException;
|
||||||
import com.fastasyncworldedit.core.util.JoinedCharSequence;
|
|
||||||
import com.fastasyncworldedit.core.util.StringMan;
|
import com.fastasyncworldedit.core.util.StringMan;
|
||||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||||
@ -1923,23 +1922,19 @@ public final class BlockTypes {
|
|||||||
public static final BlockType ZOMBIE_WALL_HEAD = init();
|
public static final BlockType ZOMBIE_WALL_HEAD = init();
|
||||||
|
|
||||||
private static Field[] fieldsTmp;
|
private static Field[] fieldsTmp;
|
||||||
private static JoinedCharSequence joined;
|
|
||||||
private static int initIndex = 0;
|
private static int initIndex = 0;
|
||||||
|
|
||||||
public static BlockType init() {
|
public static BlockType init() {
|
||||||
if (fieldsTmp == null) {
|
if (fieldsTmp == null) {
|
||||||
fieldsTmp = BlockTypes.class.getDeclaredFields();
|
fieldsTmp = BlockTypes.class.getDeclaredFields();
|
||||||
BlockTypesCache.$NAMESPACES.isEmpty(); // initialize cache
|
BlockTypesCache.$NAMESPACES.isEmpty(); // initialize cache
|
||||||
joined = new JoinedCharSequence();
|
|
||||||
}
|
}
|
||||||
String name = fieldsTmp[initIndex++].getName().toLowerCase(Locale.ROOT);
|
String name = fieldsTmp[initIndex++].getName().toLowerCase(Locale.ROOT);
|
||||||
CharSequence fullName = joined.init(BlockType.REGISTRY.getDefaultNamespace(), ':', name);
|
return BlockType.REGISTRY.get(name);
|
||||||
return BlockType.REGISTRY.getMap().get(fullName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
fieldsTmp = null;
|
fieldsTmp = null;
|
||||||
joined = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.world.item;
|
package com.sk89q.worldedit.world.item;
|
||||||
|
|
||||||
import com.fastasyncworldedit.core.util.JoinedCharSequence;
|
|
||||||
import com.fastasyncworldedit.core.world.block.ItemTypesCache;
|
import com.fastasyncworldedit.core.world.block.ItemTypesCache;
|
||||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||||
|
|
||||||
@ -2362,7 +2361,6 @@ public final class ItemTypes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Field[] fieldsTmp;
|
private static Field[] fieldsTmp;
|
||||||
private static JoinedCharSequence joined;
|
|
||||||
private static int initIndex = 0;
|
private static int initIndex = 0;
|
||||||
|
|
||||||
private static ItemType init() {
|
private static ItemType init() {
|
||||||
@ -2370,11 +2368,9 @@ public final class ItemTypes {
|
|||||||
if (fieldsTmp == null) {
|
if (fieldsTmp == null) {
|
||||||
fieldsTmp = ItemTypes.class.getDeclaredFields();
|
fieldsTmp = ItemTypes.class.getDeclaredFields();
|
||||||
ItemTypesCache.init(); // force class to load
|
ItemTypesCache.init(); // force class to load
|
||||||
joined = new JoinedCharSequence();
|
|
||||||
}
|
}
|
||||||
String name = fieldsTmp[initIndex++].getName().toLowerCase(Locale.ROOT);
|
String name = fieldsTmp[initIndex++].getName().toLowerCase(Locale.ROOT);
|
||||||
CharSequence fullName = joined.init(ItemType.REGISTRY.getDefaultNamespace(), ':', name);
|
return ItemType.REGISTRY.get(name);
|
||||||
return ItemType.REGISTRY.getMap().get(fullName);
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw e;
|
throw e;
|
||||||
@ -2383,7 +2379,6 @@ public final class ItemTypes {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
fieldsTmp = null;
|
fieldsTmp = null;
|
||||||
joined = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren