1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-31 05:33:00 +00:00

A couple of fixes for maven and CCEmuX

- Add additional maven metadata and strip dependencies
 - Shift ICommand registration into the proxy, to avoid class loading
   issues. This is probably rather temperamental, but classloading
   always is.
This commit is contained in:
SquidDev
2018-04-20 19:39:53 +01:00
parent 83546d0acb
commit a0d71cb3ad
5 changed files with 45 additions and 2 deletions

View File

@@ -462,8 +462,7 @@ public class ComputerCraft
@Mod.EventHandler
public void onServerStarting( FMLServerStartingEvent event )
{
event.registerServerCommand( new CommandComputer() );
event.registerServerCommand( new CommandComputerCraft() );
proxy.initServer( event.getServer() );
}
@Mod.EventHandler

View File

@@ -10,6 +10,8 @@ import dan200.computercraft.ComputerCraft;
import dan200.computercraft.api.ComputerCraftAPI;
import dan200.computercraft.api.pocket.IPocketUpgrade;
import dan200.computercraft.core.computer.MainThread;
import dan200.computercraft.shared.command.CommandComputer;
import dan200.computercraft.shared.command.CommandComputerCraft;
import dan200.computercraft.shared.command.ContainerViewComputer;
import dan200.computercraft.shared.common.ColourableRecipe;
import dan200.computercraft.shared.common.DefaultBundledRedstoneProvider;
@@ -51,6 +53,7 @@ import dan200.computercraft.shared.turtle.inventory.ContainerTurtle;
import dan200.computercraft.shared.util.*;
import dan200.computercraft.shared.wired.CapabilityWiredElement;
import net.minecraft.block.Block;
import net.minecraft.command.CommandHandler;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -63,6 +66,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
@@ -115,6 +119,14 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
registerForgeHandlers();
}
@Override
public void initServer( MinecraftServer server )
{
CommandHandler handler = (CommandHandler) server.getCommandManager();
handler.registerCommand( new CommandComputer() );
handler.registerCommand( new CommandComputerCraft() );
}
@Override
public abstract boolean isClient();

View File

@@ -16,6 +16,7 @@ import dan200.computercraft.shared.turtle.blocks.TileTurtle;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.EnumHand;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos;
@@ -28,6 +29,7 @@ public interface IComputerCraftProxy
{
void preInit();
void init();
void initServer( MinecraftServer server );
boolean isClient();
boolean getGlobalCursorBlink();