mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Fixes
This commit is contained in:
parent
7637905de2
commit
c5c1a9b25b
@ -255,7 +255,6 @@ public interface Matter {
|
||||
*/
|
||||
Map<Class<?>, MatterSlice<?>> getSliceMap();
|
||||
|
||||
|
||||
default void write(File f) throws IOException {
|
||||
write(f, true);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ import java.io.IOException;
|
||||
|
||||
@Data
|
||||
public class MatterHeader {
|
||||
private String author = "anonymous";
|
||||
private String author = "";
|
||||
private long createdAt = M.ms();
|
||||
private int version = Matter.VERSION;
|
||||
|
||||
|
@ -18,7 +18,9 @@
|
||||
|
||||
package com.volmit.iris.util.matter;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.cache.Cache;
|
||||
import com.volmit.iris.util.data.NibbleDataPalette;
|
||||
import com.volmit.iris.util.data.Varint;
|
||||
import com.volmit.iris.util.hunk.Hunk;
|
||||
import org.bukkit.Location;
|
||||
@ -106,6 +108,19 @@ public interface MatterSlice<T> extends Hunk<T> {
|
||||
return readFrom(mediumType) != null;
|
||||
}
|
||||
|
||||
default int getBitsPer(int needed)
|
||||
{
|
||||
int target = 1;
|
||||
for (int i = 1; i < 8; i++) {
|
||||
if (Math.pow(2, i) > needed) {
|
||||
target = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
default void write(DataOutputStream dos) throws IOException {
|
||||
int w = getWidth();
|
||||
int h = getHeight();
|
||||
|
@ -63,6 +63,12 @@ public class HyperLock {
|
||||
unlock(x, z);
|
||||
}
|
||||
|
||||
public void withLong(long k, Runnable r) {
|
||||
lock(Cache.keyX(k), Cache.keyZ(k));
|
||||
r.run();
|
||||
unlock(Cache.keyX(k), Cache.keyZ(k));
|
||||
}
|
||||
|
||||
public void withNasty(int x, int z, NastyRunnable r) throws Throwable {
|
||||
lock(x, z);
|
||||
Throwable ee = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user