mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-19 15:09:15 +00:00
优化
This commit is contained in:
@@ -2056,8 +2056,6 @@ public class BukkitNetworkManager implements NetworkManager, Listener, PluginMes
|
|||||||
buf.writeBitSet(emptyBlockYMask);
|
buf.writeBitSet(emptyBlockYMask);
|
||||||
buf.writeByteArrayList(skyUpdates);
|
buf.writeByteArrayList(skyUpdates);
|
||||||
buf.writeByteArrayList(blockUpdates);
|
buf.writeByteArrayList(blockUpdates);
|
||||||
} else {
|
|
||||||
System.out.println("没变化啊");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 记录加载的区块
|
// 记录加载的区块
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class Int2ObjectBiMap<K> implements IndexedIterable<K> {
|
|||||||
if (prev == null) break;
|
if (prev == null) break;
|
||||||
K apply = function.apply(prev);
|
K apply = function.apply(prev);
|
||||||
values[i] = apply;
|
values[i] = apply;
|
||||||
if (apply != prev) {
|
if (!apply.equals(prev)) {
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public class ArrayPalette<T> implements Palette<T> {
|
|||||||
if (prev == null) return changed;
|
if (prev == null) return changed;
|
||||||
T newV = function.apply(prev);
|
T newV = function.apply(prev);
|
||||||
this.array[i] = newV;
|
this.array[i] = newV;
|
||||||
if (newV != prev) {
|
if (!newV.equals(prev)) {
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,14 +70,16 @@ public class SingularPalette<T> implements Palette<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remap(Function<T, T> function) {
|
public void remap(Function<T, T> function) {
|
||||||
|
if (this.entry == null) return;
|
||||||
this.entry = function.apply(this.entry);
|
this.entry = function.apply(this.entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean remapAndCheck(Function<T, T> function) {
|
public boolean remapAndCheck(Function<T, T> function) {
|
||||||
|
if (this.entry == null) return false;
|
||||||
T previous = this.entry;
|
T previous = this.entry;
|
||||||
this.entry = function.apply(previous);
|
this.entry = function.apply(previous);
|
||||||
return previous == this.entry;
|
return !previous.equals(this.entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user