mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-08-27 04:37:47 +00:00
dwa
This commit is contained in:
@@ -19,6 +19,7 @@ public final class StubTileData extends TileData {
|
||||
private static final Gson GSON = new GsonBuilder()
|
||||
.disableHtmlEscaping()
|
||||
.setStrictness(Strictness.LENIENT)
|
||||
.setObjectToNumberStrategy(com.google.gson.ToNumberPolicy.LONG_OR_DOUBLE)
|
||||
.create();
|
||||
|
||||
private final String blockKey;
|
||||
|
||||
@@ -32,6 +32,24 @@ public class StubTileDataTest {
|
||||
assertEquals("minecraft:chests/ancient_city", decoded.getProperties().get("LootTable"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void modernIntegralPropertiesReencodeByteIdentical() throws Exception {
|
||||
KMap<String, Object> properties = new KMap<>();
|
||||
properties.put("LootTable", "minecraft:chests/ancient_city");
|
||||
properties.put("LootTableSeed", -7205759403792793599L);
|
||||
StubTileData original = StubTileData.fromProperties(
|
||||
StubPlatform.blockStateForTest("minecraft:chest[facing=north]"), properties);
|
||||
byte[] encoded = encode(original::toBinary);
|
||||
|
||||
StubTileData decoded;
|
||||
try (DataInputStream input = new DataInputStream(new ByteArrayInputStream(encoded))) {
|
||||
decoded = StubTileData.read(input);
|
||||
}
|
||||
|
||||
assertArrayEquals(encoded, encode(decoded::toBinary));
|
||||
assertEquals(-7205759403792793599L, decoded.getProperties().get("LootTableSeed"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void legacyLootablePayloadPreservesItsCompleteFrame() throws Exception {
|
||||
byte[] payload = encode(output -> {
|
||||
|
||||
Reference in New Issue
Block a user