diff --git a/bukkit/cpw/mods/fml/server/FMLBukkitHandler.java b/bukkit/cpw/mods/fml/server/FMLBukkitHandler.java index cb2d98f5a9..2edf7c7d74 100644 --- a/bukkit/cpw/mods/fml/server/FMLBukkitHandler.java +++ b/bukkit/cpw/mods/fml/server/FMLBukkitHandler.java @@ -43,6 +43,7 @@ import net.minecraft.server.Packet1Login; import net.minecraft.server.Packet250CustomPayload; import net.minecraft.server.Packet3Chat; import net.minecraft.server.BukkitRegistry; +import net.minecraft.server.SidedProxy; import net.minecraft.server.World; import net.minecraft.server.WorldType; import cpw.mods.fml.common.FMLCommonHandler; @@ -50,6 +51,8 @@ import cpw.mods.fml.common.IFMLSidedHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.ProxyInjector; +import cpw.mods.fml.common.Side; import cpw.mods.fml.common.modloader.ModLoaderModContainer; import cpw.mods.fml.common.modloader.ModProperty; import cpw.mods.fml.common.registry.FMLRegistry; @@ -470,24 +473,6 @@ public class FMLBukkitHandler implements IFMLSidedHandler } } - /** - * Are we a server? - */ - @Override - public boolean isServer() - { - return true; - } - - /** - * Are we a client? - */ - @Override - public boolean isClient() - { - return false; - } - @Override public File getMinecraftRootDirectory() { @@ -590,14 +575,12 @@ public class FMLBukkitHandler implements IFMLSidedHandler @Override public void profileStart(String profileLabel) { - // TODO Auto-generated method stub - + // NOOP on bukkit } @Override public void profileEnd() { - // TODO Auto-generated method stub - + // NOOP on bukkit } @Override @@ -613,4 +596,22 @@ public class FMLBukkitHandler implements IFMLSidedHandler public List getAdditionalBrandingInformation() { return null; } + + @Override + public Side getSide() { + return Side.BUKKIT; + } + + @Override + public ProxyInjector findSidedProxyOn(cpw.mods.fml.common.modloader.BaseMod mod) { + for (Field f : mod.getClass().getDeclaredFields()) + { + if (f.isAnnotationPresent(SidedProxy.class)) + { + SidedProxy sp = f.getAnnotation(SidedProxy.class); + return new ProxyInjector(sp.clientSide(), sp.serverSide(), sp.bukkitSide(), f); + } + } + return null; + } } diff --git a/bukkit/net/minecraft/server/SidedProxy.java b/bukkit/net/minecraft/server/SidedProxy.java new file mode 100644 index 0000000000..4a70c43b14 --- /dev/null +++ b/bukkit/net/minecraft/server/SidedProxy.java @@ -0,0 +1,39 @@ +/* + * The FML Forge Mod Loader suite. + * Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package net.minecraft.server; + +/** + * @author cpw + * + */ +public @interface SidedProxy +{ + /** + * The name of the client side class to load and populate + * @return + */ + String clientSide() default ""; + + /** + * The name of the server side class to load and populate + * @return + */ + String serverSide() default ""; + + /** + * The name of the a special bukkit plugin class to load and populate + */ + String bukkitSide() default ""; +}