Skip to content

Commit

Permalink
Fix veins differing between server and clients (#57)
Browse files Browse the repository at this point in the history
* fix veins differing between server and clients

* bump gt dep
  • Loading branch information
Lyfts authored Sep 22, 2024
1 parent 0c3ace2 commit 3a9161e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies {
api('com.github.GTNewHorizons:Navigator:1.0.12:dev')
api('com.github.GTNewHorizons:GTNHLib:0.5.11:dev')
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.01:dev')
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.06:dev')

runtimeOnlyNonPublishable(rfg.deobf('maven.modrinth:journeymap:5.2.6'))
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.sinthoras.visualprospecting.database.UndergroundFluidPosition;
import com.sinthoras.visualprospecting.database.veintypes.VeinTypeCaching;

import cpw.mods.fml.common.network.ByteBufUtils;
import io.netty.buffer.ByteBuf;

public final class VPByteBufUtils {
Expand All @@ -19,18 +20,18 @@ public static void WriteOreVeinPosition(ByteBuf buf, OreVeinPosition oreVeinPosi
buf.writeInt(oreVeinPosition.dimensionId);
buf.writeInt(oreVeinPosition.chunkX);
buf.writeInt(oreVeinPosition.chunkZ);
buf.writeShort(oreVeinPosition.veinType.veinId);
buf.writeBoolean(oreVeinPosition.isDepleted());
ByteBufUtils.writeUTF8String(buf, oreVeinPosition.veinType.name);
}

public static OreVeinPosition ReadOreVeinPosition(ByteBuf buf) {
final int dimId = buf.readInt();
final int chunkX = buf.readInt();
final int chunkZ = buf.readInt();
final short veinId = buf.readShort();
final boolean isDepleted = buf.readBoolean();
final String veinName = ByteBufUtils.readUTF8String(buf);

return new OreVeinPosition(dimId, chunkX, chunkZ, VeinTypeCaching.getVeinType(veinId), isDepleted);
return new OreVeinPosition(dimId, chunkX, chunkZ, VeinTypeCaching.getVeinType(veinName), isDepleted);
}

public static void WriteUndergroundFluidPosition(ByteBuf buf, UndergroundFluidPosition undergroundFluidPosition) {
Expand Down

0 comments on commit 3a9161e

Please sign in to comment.