mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
Merge commit 'e69ea37'
This commit is contained in:
@ -3,6 +3,7 @@ package com.boydti.fawe.logging.rollback;
|
||||
import com.boydti.fawe.database.DBHandler;
|
||||
import com.boydti.fawe.database.RollbackDatabase;
|
||||
import com.boydti.fawe.object.changeset.DiskStorageHistory;
|
||||
import com.boydti.fawe.object.changeset.SimpleChangeSetSummary;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
@ -395,36 +395,10 @@ public class DiskStorageHistory extends FaweStreamChangeSet {
|
||||
return new NBTInputStream(MainUtil.getCompressedIS(new FileInputStream(nbtfFile)));
|
||||
}
|
||||
|
||||
protected SimpleChangeSetSummary summarizeShallow() {
|
||||
return new SimpleChangeSetSummary(getOriginX(), getOriginZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SimpleChangeSetSummary summarize(Region region, boolean shallow) {
|
||||
if (bdFile.exists()) {
|
||||
int ox = getOriginX();
|
||||
int oz = getOriginZ();
|
||||
SimpleChangeSetSummary summary = summarizeShallow();
|
||||
if (region != null && !region.contains(ox, oz)) {
|
||||
return summary;
|
||||
}
|
||||
try (FaweInputStream fis = getBlockIS()) {
|
||||
if (!shallow) {
|
||||
int amount = (Settings.IMP.HISTORY.BUFFER_SIZE - HEADER_SIZE) / 9;
|
||||
MutableFullBlockChange change = new MutableFullBlockChange(null, 0, false);
|
||||
for (int i = 0; i < amount; i++) {
|
||||
int x = posDel.readX(fis) + ox;
|
||||
int y = posDel.readY(fis);
|
||||
int z = posDel.readZ(fis) + ox;
|
||||
idDel.readCombined(fis, change);
|
||||
summary.add(x, z, change.to);
|
||||
}
|
||||
}
|
||||
} catch (EOFException ignored) {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return summary;
|
||||
return super.summarize(region, shallow);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import com.sk89q.jnbt.NBTInputStream;
|
||||
import com.sk89q.jnbt.NBTOutputStream;
|
||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||
import com.sk89q.worldedit.history.change.Change;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
@ -729,4 +730,35 @@ public abstract class FaweStreamChangeSet extends AbstractChangeSet {
|
||||
public Iterator<Change> forwardIterator() {
|
||||
return getIterator(true);
|
||||
}
|
||||
|
||||
protected SimpleChangeSetSummary summarizeShallow() {
|
||||
return new SimpleChangeSetSummary(getOriginX(), getOriginZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SimpleChangeSetSummary summarize(Region region, boolean shallow) {
|
||||
int ox = getOriginX();
|
||||
int oz = getOriginZ();
|
||||
SimpleChangeSetSummary summary = summarizeShallow();
|
||||
if (region != null && !region.contains(ox, oz)) {
|
||||
return summary;
|
||||
}
|
||||
try (FaweInputStream fis = getBlockIS()) {
|
||||
if (!shallow) {
|
||||
int amount = (Settings.IMP.HISTORY.BUFFER_SIZE - HEADER_SIZE) / 9;
|
||||
MutableFullBlockChange change = new MutableFullBlockChange(null, 0, false);
|
||||
for (int i = 0; i < amount; i++) {
|
||||
int x = posDel.readX(fis) + ox;
|
||||
int y = posDel.readY(fis);
|
||||
int z = posDel.readZ(fis) + ox;
|
||||
idDel.readCombined(fis, change);
|
||||
summary.add(x, z, change.to);
|
||||
}
|
||||
}
|
||||
} catch (EOFException ignored) {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return summary;
|
||||
}
|
||||
}
|
||||
|
@ -3,12 +3,16 @@ package com.boydti.fawe.object.changeset;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.FaweInputStream;
|
||||
import com.boydti.fawe.object.FaweOutputStream;
|
||||
import com.boydti.fawe.object.change.MutableFullBlockChange;
|
||||
import com.boydti.fawe.object.io.FastByteArrayOutputStream;
|
||||
import com.boydti.fawe.object.io.FastByteArraysInputStream;
|
||||
import com.boydti.fawe.util.MainUtil;
|
||||
import com.sk89q.jnbt.NBTInputStream;
|
||||
import com.sk89q.jnbt.NBTOutputStream;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@ -241,6 +245,5 @@ public class MemoryOptimizedHistory extends FaweStreamChangeSet {
|
||||
@Override
|
||||
public void setRecordChanges(boolean recordChanges) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -13,11 +13,11 @@ public enum Jars {
|
||||
|
||||
MM_v1_7_3(
|
||||
"https://github.com/InventivetalentDev/MapManager/releases/download/1.7.3-SNAPSHOT/MapManager_v1.7.3-SNAPSHOT.jar",
|
||||
"M3YLUQZZ66K2DMVDCYLEU38U3ZKRKHRAXQGGPVKFO6G=", 554831),
|
||||
"m3YLUqZz66k2DmvdcYLeu38u3zKRKhrAXqGGpVKfO6g=", 554831),
|
||||
|
||||
PL_v3_7_3(
|
||||
"https://github.com/InventivetalentDev/PacketListenerAPI/releases/download/3.7.3-SNAPSHOT/PacketListenerAPI_v3.7.3-SNAPSHOT.jar",
|
||||
"ETDBRZLN5PRVDFR/MSQDPM6JJER3WQOKHCN8FUXO5ZM=", 167205),
|
||||
"etdBRzLn5pRVDfr/mSQdPm6Jjer3wQOKhcn8fUxo5zM=", 167205),
|
||||
|
||||
;
|
||||
|
||||
@ -27,12 +27,12 @@ public enum Jars {
|
||||
|
||||
/**
|
||||
* @param url Where this jar can be found and downloaded
|
||||
* @param digest The SHA-256 hexadecimal digest
|
||||
* @param digest The Base64-encoded SHA-256 digest
|
||||
* @param fileSize Size of this jar in bytes
|
||||
*/
|
||||
Jars(String url, String digest, int fileSize) {
|
||||
this.url = url;
|
||||
this.digest = digest.toUpperCase();
|
||||
this.digest = digest;
|
||||
this.fileSize = fileSize;
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ public enum Jars {
|
||||
MessageDigest md = MessageDigest.getInstance("SHA-256");
|
||||
byte[] jarDigestBytes = md.digest(jarBytes);
|
||||
|
||||
String jarDigest = Base64.getEncoder().encodeToString(jarDigestBytes).toUpperCase();
|
||||
String jarDigest = Base64.getEncoder().encodeToString(jarDigestBytes);
|
||||
|
||||
if (this.digest.equals(jarDigest)) {
|
||||
getLogger(Jars.class).debug("++++ HASH CHECK ++++");
|
||||
|
Reference in New Issue
Block a user