Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/pom.xml b/pom.xml
- index fce78d7..e60c431 100644
- --- a/pom.xml
- +++ b/pom.xml
- @@ -32,6 +32,10 @@
- <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
- </repository>
- <repository>
- + <id>sponge</id>
- + <url>http://repo.spongepowered.org/maven</url>
- + </repository>
- + <repository>
- <id>viaversion-repo</id>
- <url>https://repo.viaversion.com/</url>
- </repository>
- @@ -45,6 +49,12 @@
- <scope>provided</scope>
- </dependency>
- <dependency>
- + <groupId>org.spongepowered</groupId>
- + <artifactId>spongeapi</artifactId>
- + <version>5.0.0-20161003.050154-143</version>
- + <scope>provided</scope>
- + </dependency>
- + <dependency>
- <groupId>us.myles</groupId>
- <artifactId>viaversion</artifactId>
- <version>1.0.0-ALPHA-modules</version>
- diff --git a/src/main/java/nl/matsv/viabackwards/SpongePlugin.java b/src/main/java/nl/matsv/viabackwards/SpongePlugin.java
- new file mode 100644
- index 0000000..55c1196
- --- /dev/null
- +++ b/src/main/java/nl/matsv/viabackwards/SpongePlugin.java
- @@ -0,0 +1,39 @@
- +/*
- + *
- + * Copyright (C) 2016 Maxqia
- + *
- + * This program is free software: you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation, either version 3 of the License, or
- + * (at your option) any later version.
- + *
- + * This program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +
- +package nl.matsv.viabackwards;
- +
- +import nl.matsv.viabackwards.protocol.protocol1_9_4to1_10.Protocol1_9To1_10;
- +import org.spongepowered.api.event.Listener;
- +import org.spongepowered.api.event.game.state.GameAboutToStartServerEvent;
- +import org.spongepowered.api.event.game.state.GameLoadCompleteEvent;
- +import org.spongepowered.api.plugin.Plugin;
- +import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
- +import us.myles.ViaVersion.api.protocol.ProtocolVersion;
- +
- +import java.util.Collections;
- +
- +@Plugin(id = "xviabackwards", name = "ViaBackwards", version = "1.0.2-DEV")
- +public class SpongePlugin {
- + @Listener
- + public void onServerStart(GameLoadCompleteEvent event) {
- + System.out.println("Registering Protocol!");
- + // Register the protocol
- + ProtocolRegistry.registerProtocol(new Protocol1_9To1_10(), Collections.singletonList(ProtocolVersion.v1_9_3.getId()), ProtocolVersion.v1_10.getId());
- + }
- +}
- diff --git a/src/main/java/nl/matsv/viabackwards/api/rewriters/EntityRewriter.java b/src/main/java/nl/matsv/viabackwards/api/rewriters/EntityRewriter.java
- index 18b4b8b..b5b5668 100644
- --- a/src/main/java/nl/matsv/viabackwards/api/rewriters/EntityRewriter.java
- +++ b/src/main/java/nl/matsv/viabackwards/api/rewriters/EntityRewriter.java
- @@ -24,7 +24,7 @@ import nl.matsv.viabackwards.api.MetaRewriter;
- import nl.matsv.viabackwards.api.exceptions.RemovedValueException;
- import nl.matsv.viabackwards.api.storage.EntityTracker;
- import nl.matsv.viabackwards.api.storage.EntityType;
- -import org.bukkit.Bukkit;
- +import us.myles.ViaVersion.api.Via;
- import us.myles.ViaVersion.api.ViaVersion;
- import us.myles.ViaVersion.api.data.UserConnection;
- import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
- @@ -112,7 +112,7 @@ public abstract class EntityRewriter<T extends BackwardsProtocol> extends Rewrit
- } catch (RemovedValueException ignored) {
- } catch (Exception e) {
- if (ViaVersion.getInstance().isDebug()) {
- - Logger log = Bukkit.getPluginManager().getPlugin("ViaBackwards").getLogger();
- + Logger log = Via.getPlatform().getLogger();
- log.warning("Unable to handle metadata " + md);
- log.warning("Full metadata list " + metaData);
- e.printStackTrace();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement