Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-24 18:10:08 +01:00
Merge pull request #76 from IntellectualSites/new-vector-system2
Revert "Make end tag singleton"
Dieser Commit ist enthalten in:
Commit
4c3b09895d
@ -440,7 +440,7 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit
|
|||||||
} else if (foreign instanceof NBTTagString) {
|
} else if (foreign instanceof NBTTagString) {
|
||||||
return new StringTag(foreign.asString()); // data
|
return new StringTag(foreign.asString()); // data
|
||||||
} else if (foreign instanceof NBTTagEnd) {
|
} else if (foreign instanceof NBTTagEnd) {
|
||||||
return EndTag.INSTANCE;
|
return new EndTag();
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Don't know how to make native " + foreign.getClass().getCanonicalName());
|
throw new IllegalArgumentException("Don't know how to make native " + foreign.getClass().getCanonicalName());
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ public class FaweCache {
|
|||||||
if (clazz.getName().startsWith("com.intellectualcrafters.jnbt")) {
|
if (clazz.getName().startsWith("com.intellectualcrafters.jnbt")) {
|
||||||
try {
|
try {
|
||||||
if (clazz.getName().equals("com.intellectualcrafters.jnbt.EndTag")) {
|
if (clazz.getName().equals("com.intellectualcrafters.jnbt.EndTag")) {
|
||||||
return EndTag.INSTANCE;
|
return new EndTag();
|
||||||
}
|
}
|
||||||
Field field = clazz.getDeclaredField("value");
|
Field field = clazz.getDeclaredField("value");
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
|
@ -9,24 +9,18 @@ import java.io.DataInput;
|
|||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
public class NBTStreamer {
|
public class NBTStreamer {
|
||||||
private final NBTInputStream is;
|
private final NBTInputStream is;
|
||||||
private final Map<String, BiConsumer> readers;
|
private final HashMap<String, BiConsumer> readers;
|
||||||
|
|
||||||
public NBTStreamer(NBTInputStream stream) {
|
public NBTStreamer(NBTInputStream stream) {
|
||||||
this.is = stream;
|
this.is = stream;
|
||||||
readers = new HashMap<>();
|
readers = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTStreamer(NBTInputStream stream, Map<String, BiConsumer> readers) {
|
|
||||||
this.is = stream;
|
|
||||||
this.readers = readers;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads the entire stream and runs the applicable readers
|
* Reads the entire stream and runs the applicable readers
|
||||||
*
|
*
|
||||||
|
@ -1,40 +1,37 @@
|
|||||||
/*
|
/*
|
||||||
* WorldEdit, a Minecraft world manipulation toolkit
|
* WorldEdit, a Minecraft world manipulation toolkit
|
||||||
* Copyright (C) sk89q <http://www.sk89q.com>
|
* Copyright (C) sk89q <http://www.sk89q.com>
|
||||||
* Copyright (C) WorldEdit team and contributors
|
* Copyright (C) WorldEdit team and contributors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU Lesser General Public License as published by the
|
* under the terms of the GNU Lesser General Public License as published by the
|
||||||
* Free Software Foundation, either version 3 of the License, or
|
* Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||||
* for more details.
|
* for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.sk89q.jnbt;
|
package com.sk89q.jnbt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@code TAG_End} tag.
|
* The {@code TAG_End} tag.
|
||||||
*/
|
*/
|
||||||
public final class EndTag extends Tag {
|
public final class EndTag extends Tag {
|
||||||
public static final EndTag INSTANCE = new EndTag();
|
|
||||||
|
@Override
|
||||||
private EndTag() {}
|
public Object getValue() {
|
||||||
|
return null;
|
||||||
@Override
|
}
|
||||||
public Object getValue() {
|
|
||||||
return null;
|
@Override
|
||||||
}
|
public String toString() {
|
||||||
|
return "TAG_End";
|
||||||
@Override
|
}
|
||||||
public String toString() {
|
|
||||||
return "TAG_End";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
@ -217,7 +217,7 @@ final class NBTConverter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static EndTag fromNative(NBTTagEnd other) {
|
public static EndTag fromNative(NBTTagEnd other) {
|
||||||
return EndTag.INSTANCE;
|
return new EndTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LongTag fromNative(NBTTagLong other) {
|
public static LongTag fromNative(NBTTagLong other) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren