3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-07-26 17:08:05 +02:00

Update VV item/position usage

Dieser Commit ist enthalten in:
KennyTV 2019-12-14 11:34:57 +01:00
Ursprung 31b3acdba7
Commit 98eb47c360
3 geänderte Dateien mit 16 neuen und 16 gelöschten Zeilen

Datei anzeigen

@ -232,7 +232,7 @@ public abstract class BlockItemRewriter<T extends BackwardsProtocol> extends Rew
private CompoundTag createViaNBT(Item i) {
CompoundTag tag = new CompoundTag(nbtTagName);
tag.put(new ShortTag("id", i.getId()));
tag.put(new ShortTag("id", (short) i.getIdentifier()));
tag.put(new ShortTag("data", i.getData()));
tag.put(new ByteTag("amount", i.getAmount()));
if (i.getTag() != null) {

Datei anzeigen

@ -213,9 +213,9 @@ public class BlockItemPackets1_13 extends BlockItemRewriter<Protocol1_12_2To1_13
int chunkZ = wrapper.get(Type.INT, 1);
int block = record.getBlockId();
Position position = new Position(
(long) (record.getHorizontal() >> 4 & 15) + (chunkX * 16),
(long) record.getY(),
(long) (record.getHorizontal() & 15) + (chunkZ * 16));
(record.getHorizontal() >> 4 & 15) + (chunkX * 16),
record.getY(),
(record.getHorizontal() & 15) + (chunkZ * 16));
// Store if needed
storage.checkAndStore(position, block);
@ -288,7 +288,7 @@ public class BlockItemPackets1_13 extends BlockItemRewriter<Protocol1_12_2To1_13
int x = (int) tag.get("x").getValue();
int y = (int) tag.get("y").getValue();
int z = (int) tag.get("z").getValue();
Position position = new Position((long) x, (long) y, (long) z);
Position position = new Position(x, (short) y, z);
int block = section.getFlatBlock(x & 0xF, y & 0xF, z & 0xF);
storage.checkAndStore(position, block);
@ -312,9 +312,9 @@ public class BlockItemPackets1_13 extends BlockItemRewriter<Protocol1_12_2To1_13
// Check if the block is a flower
if (FlowerPotHandler.isFlowah(block)) {
Position pos = new Position(
(long) (x + (chunk.getX() << 4)),
(long) (y + (i << 4)),
(long) (z + (chunk.getZ() << 4))
(x + (chunk.getX() << 4)),
(short) (y + (i << 4)),
(z + (chunk.getZ() << 4))
);
// Store block
storage.checkAndStore(pos, block);

Datei anzeigen

@ -388,11 +388,11 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
} else if (channel.equals("MC|AutoCmd")) {
wrapper.setId(0x22);
Integer x = wrapper.read(Type.INT);
Integer y = wrapper.read(Type.INT);
Integer z = wrapper.read(Type.INT);
int x = wrapper.read(Type.INT);
int y = wrapper.read(Type.INT);
int z = wrapper.read(Type.INT);
wrapper.write(Type.POSITION, new Position(x.longValue(), y.longValue(), z.longValue()));
wrapper.write(Type.POSITION, new Position(x, (short) y, z));
wrapper.passthrough(Type.STRING); //Command
@ -410,10 +410,10 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
wrapper.write(Type.BYTE, flags);
} else if (channel.equals("MC|Struct")) {
wrapper.setId(0x25);
Integer x = wrapper.read(Type.INT);
Integer y = wrapper.read(Type.INT);
Integer z = wrapper.read(Type.INT);
wrapper.write(Type.POSITION, new Position(x.longValue(), y.longValue(), z.longValue()));
int x = wrapper.read(Type.INT);
int y = wrapper.read(Type.INT);
int z = wrapper.read(Type.INT);
wrapper.write(Type.POSITION, new Position(x, (short) y, z));
wrapper.write(Type.VAR_INT, wrapper.read(Type.BYTE) - 1);
String mode = wrapper.read(Type.STRING);
int modeId = mode.equals("SAVE") ? 0 : mode.equals("LOAD") ? 1 : mode.equals("CORNER") ? 2 : 3;