diff --git a/core/src/main/java/nl/matsv/viabackwards/api/ViaBackwardsPlatform.java b/core/src/main/java/nl/matsv/viabackwards/api/ViaBackwardsPlatform.java index 24c9528d..e8baa248 100644 --- a/core/src/main/java/nl/matsv/viabackwards/api/ViaBackwardsPlatform.java +++ b/core/src/main/java/nl/matsv/viabackwards/api/ViaBackwardsPlatform.java @@ -13,6 +13,7 @@ package nl.matsv.viabackwards.api; import nl.matsv.viabackwards.ViaBackwards; import nl.matsv.viabackwards.protocol.protocol1_10to1_11.Protocol1_10To1_11; import nl.matsv.viabackwards.protocol.protocol1_11to1_11_1.Protocol1_11To1_11_1; +import nl.matsv.viabackwards.protocol.protocol1_12to1_11_1.Protocol1_12To1_11_1; import nl.matsv.viabackwards.protocol.protocol1_9_4to1_10.Protocol1_9_4To1_10; import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection; import us.myles.ViaVersion.api.protocol.ProtocolRegistry; @@ -33,6 +34,7 @@ public interface ViaBackwardsPlatform { ProtocolRegistry.registerProtocol(new Protocol1_9_4To1_10(), Collections.singletonList(ProtocolVersion.v1_9_3.getId()), ProtocolVersion.v1_10.getId()); ProtocolRegistry.registerProtocol(new Protocol1_10To1_11(), Collections.singletonList(ProtocolVersion.v1_10.getId()), ProtocolVersion.v1_11.getId()); ProtocolRegistry.registerProtocol(new Protocol1_11To1_11_1(), Collections.singletonList(ProtocolVersion.v1_11.getId()), ProtocolVersion.v1_11_1.getId()); + ProtocolRegistry.registerProtocol(new Protocol1_12To1_11_1(), Collections.singletonList(ProtocolVersion.v1_11_1.getId()), ProtocolVersion.v1_12.getId()); } } diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets.java index 7ea2f4bc..0cd5d7a3 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets.java @@ -10,6 +10,7 @@ package nl.matsv.viabackwards.protocol.protocol1_10to1_11.packets; +import net.md_5.bungee.api.ChatColor; import nl.matsv.viabackwards.api.entities.storage.EntityTracker; import nl.matsv.viabackwards.api.entities.types.EntityType1_11; import nl.matsv.viabackwards.api.rewriters.BlockItemRewriter; @@ -415,7 +416,6 @@ public class BlockItemPackets extends BlockItemRewriter { private boolean isLlama(UserConnection user) { WindowTracker tracker = user.get(WindowTracker.class); if (tracker.getInventory() != null && tracker.getInventory().equals("EntityHorse")) { - System.out.println(tracker + " tracker"); EntityTracker.ProtocolEntityTracker entTracker = user.get(EntityTracker.class).get(getProtocol()); if (tracker.getEntityId() != -1 && entTracker.getEntity(tracker.getEntityId()).getType().is(EntityType1_11.EntityType.LIAMA)) return true; @@ -468,7 +468,7 @@ public class BlockItemPackets extends BlockItemRewriter { int endNonExistingFormula = 2 + 3 * (storage.isChested() ? 5 : 0); if (slotId >= startNonExistingFormula && slotId < endNonExistingFormula) - return new Item((short) 166, (byte) 1, (short) 0, getNamedTag("NOT IN USE")); + return new Item((short) 166, (byte) 1, (short) 0, getNamedTag(ChatColor.RED + "SLOT DISABLED")); if (slotId == 1) return null; return current; diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12to1_11_1/Protocol1_12To1_11_1.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12to1_11_1/Protocol1_12To1_11_1.java new file mode 100644 index 00000000..cbc86613 --- /dev/null +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12to1_11_1/Protocol1_12To1_11_1.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016 Matsv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package nl.matsv.viabackwards.protocol.protocol1_12to1_11_1; + +import nl.matsv.viabackwards.api.BackwardsProtocol; +import nl.matsv.viabackwards.api.entities.storage.EntityTracker; +import us.myles.ViaVersion.api.data.UserConnection; +import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; + +public class Protocol1_12To1_11_1 extends BackwardsProtocol { + @Override + protected void registerPackets() { + + } + + @Override + public void init(UserConnection user) { + // Register ClientWorld + if (!user.has(ClientWorld.class)) + user.put(new ClientWorld(user)); + + // Register EntityTracker if it doesn't exist yet. + if (!user.has(EntityTracker.class)) + user.put(new EntityTracker(user)); + + // Init protocol in EntityTracker + user.get(EntityTracker.class).initProtocol(this); + } +} diff --git a/pom.xml b/pom.xml index bb8da3e3..7615f1da 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ us.myles viaversion - 1.1.0-1_12pre7 + 1.1.0 provided