mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-21 23:51:36 +01:00
Move traversePathWrite call
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
0e082634d5
commit
92b11eabbd
@ -100,8 +100,8 @@ final class TagHandlerImpl implements TagHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private synchronized <T> T updateTag0(@NotNull Tag<T> tag, @NotNull UnaryOperator<T> value, boolean returnPrevious) {
|
private synchronized <T> T updateTag0(@NotNull Tag<T> tag, @NotNull UnaryOperator<T> value, boolean returnPrevious) {
|
||||||
|
final Node node = traversePathWrite(root, tag, true);
|
||||||
if (tag.isView()) {
|
if (tag.isView()) {
|
||||||
Node node = traversePathWrite(root, tag, true);
|
|
||||||
final T previousValue = tag.read(node.compound());
|
final T previousValue = tag.read(node.compound());
|
||||||
final T newValue = value.apply(previousValue);
|
final T newValue = value.apply(previousValue);
|
||||||
node.updateContent((NBTCompoundLike) tag.entry.write(newValue));
|
node.updateContent((NBTCompoundLike) tag.entry.write(newValue));
|
||||||
@ -110,7 +110,6 @@ final class TagHandlerImpl implements TagHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int tagIndex = tag.index;
|
final int tagIndex = tag.index;
|
||||||
final Node node = traversePathWrite(root, tag, true);
|
|
||||||
StaticIntMap<Entry<?>> entries = node.entries;
|
StaticIntMap<Entry<?>> entries = node.entries;
|
||||||
|
|
||||||
final Entry previousEntry = entries.get(tagIndex);
|
final Entry previousEntry = entries.get(tagIndex);
|
||||||
|
Loading…
Reference in New Issue
Block a user