mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-13 14:58:35 +00:00
some hasty refactoring
This commit is contained in:
@ -306,23 +306,6 @@ public enum ClipboardFormat {
|
||||
map.put("height", dimensions.getY());
|
||||
map.put("length", dimensions.getZ());
|
||||
map.put("creator", user);
|
||||
if (clipboard instanceof BlockArrayClipboard) {
|
||||
FaweClipboard fc = ((BlockArrayClipboard) clipboard).IMP;
|
||||
final int[] ids = new int[BlockTypes.size()];
|
||||
fc.streamCombinedIds(new NBTStreamer.ByteReader() {
|
||||
@Override
|
||||
public void run(int index, int byteValue) {
|
||||
ids[byteValue & BlockTypes.BIT_MASK]++;
|
||||
}
|
||||
});
|
||||
Map<String, Integer> blocks = new HashMap<String, Integer>();
|
||||
for (int i = 0; i < ids.length; i++) {
|
||||
if (ids[i] != 0) {
|
||||
blocks.put(BlockTypes.get(i).getId(), ids[i]);
|
||||
}
|
||||
}
|
||||
map.put("blocks", blocks);
|
||||
}
|
||||
Gson gson = new Gson();
|
||||
String json = gson.toJson(map);
|
||||
return MainUtil.upload(Settings.IMP.WEB.ASSETS, false, json, category, null, new RunnableVal<OutputStream>() {
|
||||
|
@ -154,7 +154,7 @@ public class BlockTransformExtent extends ResettableExtent {
|
||||
int maskedId = internalId & mask;
|
||||
int newMaskedId = arr[maskedId];
|
||||
if (newMaskedId != -1) {
|
||||
return BlockState.get(newMaskedId | (internalId & (~mask)));
|
||||
return BlockState.getFromInternalId(newMaskedId | (internalId & (~mask)));
|
||||
}
|
||||
newMaskedId = state.getInternalId();
|
||||
|
||||
@ -169,7 +169,7 @@ public class BlockTransformExtent extends ResettableExtent {
|
||||
}
|
||||
}
|
||||
arr[maskedId] = newMaskedId & mask;
|
||||
return BlockState.get(newMaskedId);
|
||||
return BlockState.getFromInternalId(newMaskedId);
|
||||
}
|
||||
|
||||
public final BlockState transformFast(BlockState block) {
|
||||
|
Reference in New Issue
Block a user