3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-27 00:22:53 +01:00

Fix some warnings

Dieser Commit ist enthalten in:
Matsv 2016-08-06 12:43:46 +02:00
Ursprung 782b29baed
Commit e26c34daf5
3 geänderte Dateien mit 8 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -34,7 +34,7 @@ public class Chunk1_10 implements Chunk {
private int bitmask; private int bitmask;
private ChunkSection1_10[] sections; private ChunkSection1_10[] sections;
private byte[] biomeData; private byte[] biomeData;
List<CompoundTag> blockEntities; private List<CompoundTag> blockEntities;
@Override @Override
public boolean isBiomeData() { public boolean isBiomeData() {

Datei anzeigen

@ -20,6 +20,7 @@ package nl.matsv.viabackwards.protocol.protocol1_9_4to1_10.chunks;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import org.apache.commons.lang.IllegalClassException;
import org.bukkit.World; import org.bukkit.World;
import us.myles.ViaVersion.api.minecraft.chunks.Chunk; import us.myles.ViaVersion.api.minecraft.chunks.Chunk;
import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection; import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection;
@ -46,7 +47,7 @@ public class Chunk1_10Type extends PartialType<Chunk, ClientWorld> {
boolean groundUp = input.readBoolean(); boolean groundUp = input.readBoolean();
int primaryBitmask = Type.VAR_INT.read(input); int primaryBitmask = Type.VAR_INT.read(input);
int size = Type.VAR_INT.read(input); Type.VAR_INT.read(input);
BitSet usedSections = new BitSet(16); BitSet usedSections = new BitSet(16);
ChunkSection1_10[] sections = new ChunkSection1_10[16]; ChunkSection1_10[] sections = new ChunkSection1_10[16];
@ -82,7 +83,7 @@ public class Chunk1_10Type extends PartialType<Chunk, ClientWorld> {
@Override @Override
public void write(ByteBuf output, ClientWorld world, Chunk input) throws Exception { public void write(ByteBuf output, ClientWorld world, Chunk input) throws Exception {
if (!(input instanceof Chunk1_10)) if (!(input instanceof Chunk1_10))
throw new Exception("Tried to send the wrong chunk type from 1.9.3-4 chunk: " + input.getClass()); throw new IllegalClassException("Tried to send the wrong chunk type from 1.9.3-4 chunk: " + input.getClass());
Chunk1_10 chunk = (Chunk1_10) input; Chunk1_10 chunk = (Chunk1_10) input;
output.writeInt(chunk.getX()); output.writeInt(chunk.getX());

Datei anzeigen

@ -322,6 +322,7 @@ public class EntityPackets extends EntityRewriter<Protocol1_9To1_10> {
protected void registerRewrites() { protected void registerRewrites() {
rewriteEntityId(102, 91); // Replace polar bear with sheep rewriteEntityId(102, 91); // Replace polar bear with sheep
// Handle Polar bear
registerMetaRewriter((isObject, entityType, data) -> { // Change the sheep color when the polar bear is stending up registerMetaRewriter((isObject, entityType, data) -> { // Change the sheep color when the polar bear is stending up
if (!isObject && entityType != 102) if (!isObject && entityType != 102)
return data; return data;
@ -337,6 +338,7 @@ public class EntityPackets extends EntityRewriter<Protocol1_9To1_10> {
return data; return data;
}); });
// Handle Husk
registerMetaRewriter((isObject, entityType, data) -> { // Change husk to normal zombie registerMetaRewriter((isObject, entityType, data) -> { // Change husk to normal zombie
if (isObject || entityType != 54) if (isObject || entityType != 54)
return data; return data;
@ -346,6 +348,7 @@ public class EntityPackets extends EntityRewriter<Protocol1_9To1_10> {
return data; return data;
}); });
// Handle stray
registerMetaRewriter((isObject, entityType, data) -> { // Change stray- to normal skeleton registerMetaRewriter((isObject, entityType, data) -> { // Change stray- to normal skeleton
if (isObject || entityType != 51) if (isObject || entityType != 51)
return data; return data;
@ -355,6 +358,7 @@ public class EntityPackets extends EntityRewriter<Protocol1_9To1_10> {
return data; return data;
}); });
// Handle the missing NoGravity tag
registerMetaRewriter((isObject, entityType, m) -> { registerMetaRewriter((isObject, entityType, m) -> {
if (m.getId() == 5) if (m.getId() == 5)
throw new RemovedValueException(); throw new RemovedValueException();