Fix some warnings

This commit is contained in:
Matsv 2016-08-06 12:43:46 +02:00
parent 782b29baed
commit e26c34daf5
3 changed files with 8 additions and 3 deletions

View File

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

View File

@ -20,6 +20,7 @@ package nl.matsv.viabackwards.protocol.protocol1_9_4to1_10.chunks;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.apache.commons.lang.IllegalClassException;
import org.bukkit.World;
import us.myles.ViaVersion.api.minecraft.chunks.Chunk;
import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection;
@ -46,7 +47,7 @@ public class Chunk1_10Type extends PartialType<Chunk, ClientWorld> {
boolean groundUp = input.readBoolean();
int primaryBitmask = Type.VAR_INT.read(input);
int size = Type.VAR_INT.read(input);
Type.VAR_INT.read(input);
BitSet usedSections = new BitSet(16);
ChunkSection1_10[] sections = new ChunkSection1_10[16];
@ -82,7 +83,7 @@ public class Chunk1_10Type extends PartialType<Chunk, ClientWorld> {
@Override
public void write(ByteBuf output, ClientWorld world, Chunk input) throws Exception {
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;
output.writeInt(chunk.getX());

View File

@ -322,6 +322,7 @@ public class EntityPackets extends EntityRewriter<Protocol1_9To1_10> {
protected void registerRewrites() {
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
if (!isObject && entityType != 102)
return data;
@ -337,6 +338,7 @@ public class EntityPackets extends EntityRewriter<Protocol1_9To1_10> {
return data;
});
// Handle Husk
registerMetaRewriter((isObject, entityType, data) -> { // Change husk to normal zombie
if (isObject || entityType != 54)
return data;
@ -346,6 +348,7 @@ public class EntityPackets extends EntityRewriter<Protocol1_9To1_10> {
return data;
});
// Handle stray
registerMetaRewriter((isObject, entityType, data) -> { // Change stray- to normal skeleton
if (isObject || entityType != 51)
return data;
@ -355,6 +358,7 @@ public class EntityPackets extends EntityRewriter<Protocol1_9To1_10> {
return data;
});
// Handle the missing NoGravity tag
registerMetaRewriter((isObject, entityType, m) -> {
if (m.getId() == 5)
throw new RemovedValueException();