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();
|
Map<Class<?>, MatterSlice<?>> getSliceMap();
|
||||||
|
|
||||||
|
|
||||||
default void write(File f) throws IOException {
|
default void write(File f) throws IOException {
|
||||||
write(f, true);
|
write(f, true);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ import java.io.IOException;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class MatterHeader {
|
public class MatterHeader {
|
||||||
private String author = "anonymous";
|
private String author = "";
|
||||||
private long createdAt = M.ms();
|
private long createdAt = M.ms();
|
||||||
private int version = Matter.VERSION;
|
private int version = Matter.VERSION;
|
||||||
|
|
||||||
|
@ -18,7 +18,9 @@
|
|||||||
|
|
||||||
package com.volmit.iris.util.matter;
|
package com.volmit.iris.util.matter;
|
||||||
|
|
||||||
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.engine.data.cache.Cache;
|
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.data.Varint;
|
||||||
import com.volmit.iris.util.hunk.Hunk;
|
import com.volmit.iris.util.hunk.Hunk;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -106,6 +108,19 @@ public interface MatterSlice<T> extends Hunk<T> {
|
|||||||
return readFrom(mediumType) != null;
|
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 {
|
default void write(DataOutputStream dos) throws IOException {
|
||||||
int w = getWidth();
|
int w = getWidth();
|
||||||
int h = getHeight();
|
int h = getHeight();
|
||||||
|
@ -63,6 +63,12 @@ public class HyperLock {
|
|||||||
unlock(x, z);
|
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 {
|
public void withNasty(int x, int z, NastyRunnable r) throws Throwable {
|
||||||
lock(x, z);
|
lock(x, z);
|
||||||
Throwable ee = null;
|
Throwable ee = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user