Skip to content

Commit a0d71cb

Browse files
committed
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.
1 parent 83546d0 commit a0d71cb

File tree

5 files changed

+45
-2
lines changed

5 files changed

+45
-2
lines changed

build.gradle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,40 @@ uploadArchives {
144144
if(project.hasProperty('mavenUploadUrl')) {
145145
mavenDeployer {
146146
configuration = configurations.deployerJars
147+
147148
repository(url: project.property('mavenUploadUrl')) {
148149
authentication(
149150
userName: project.property('mavenUploadUser'),
150151
privateKey: project.property('mavenUploadKey'))
151152
}
153+
154+
pom.project {
155+
name 'CC: Tweaked'
156+
packaging 'jar'
157+
description 'A fork of ComputerCraft which aims to provide earlier access to the more experimental and in-development features of the mod.'
158+
url 'https://github.com/SquidDev-CC/CC-Tweaked'
159+
160+
scm {
161+
url 'https://github.com/dan200/ComputerCraft.git'
162+
}
163+
164+
issueManagement {
165+
system 'github'
166+
url 'https://github.com/dan200/ComputerCraft/issues'
167+
}
168+
169+
licenses {
170+
license {
171+
name 'ComputerCraft Public License, Version 1.0'
172+
url 'https://github.com/dan200/ComputerCraft/blob/master/LICENSE'
173+
distribution 'repo'
174+
}
175+
}
176+
}
177+
178+
pom.whenConfigured { pom ->
179+
pom.dependencies.clear()
180+
}
152181
}
153182
}
154183
}

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'cc-tweaked'

src/main/java/dan200/computercraft/ComputerCraft.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,7 @@ public void init( FMLInitializationEvent event )
462462
@Mod.EventHandler
463463
public void onServerStarting( FMLServerStartingEvent event )
464464
{
465-
event.registerServerCommand( new CommandComputer() );
466-
event.registerServerCommand( new CommandComputerCraft() );
465+
proxy.initServer( event.getServer() );
467466
}
468467

469468
@Mod.EventHandler

src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import dan200.computercraft.api.ComputerCraftAPI;
1111
import dan200.computercraft.api.pocket.IPocketUpgrade;
1212
import dan200.computercraft.core.computer.MainThread;
13+
import dan200.computercraft.shared.command.CommandComputer;
14+
import dan200.computercraft.shared.command.CommandComputerCraft;
1315
import dan200.computercraft.shared.command.ContainerViewComputer;
1416
import dan200.computercraft.shared.common.ColourableRecipe;
1517
import dan200.computercraft.shared.common.DefaultBundledRedstoneProvider;
@@ -51,6 +53,7 @@
5153
import dan200.computercraft.shared.util.*;
5254
import dan200.computercraft.shared.wired.CapabilityWiredElement;
5355
import net.minecraft.block.Block;
56+
import net.minecraft.command.CommandHandler;
5457
import net.minecraft.creativetab.CreativeTabs;
5558
import net.minecraft.entity.player.EntityPlayer;
5659
import net.minecraft.entity.player.EntityPlayerMP;
@@ -63,6 +66,7 @@
6366
import net.minecraft.item.crafting.IRecipe;
6467
import net.minecraft.item.crafting.Ingredient;
6568
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
69+
import net.minecraft.server.MinecraftServer;
6670
import net.minecraft.tileentity.TileEntity;
6771
import net.minecraft.util.*;
6872
import net.minecraft.util.math.BlockPos;
@@ -115,6 +119,14 @@ public void init()
115119
registerForgeHandlers();
116120
}
117121

122+
@Override
123+
public void initServer( MinecraftServer server )
124+
{
125+
CommandHandler handler = (CommandHandler) server.getCommandManager();
126+
handler.registerCommand( new CommandComputer() );
127+
handler.registerCommand( new CommandComputerCraft() );
128+
}
129+
118130
@Override
119131
public abstract boolean isClient();
120132

src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import net.minecraft.entity.player.EntityPlayer;
1717
import net.minecraft.entity.player.InventoryPlayer;
1818
import net.minecraft.item.ItemStack;
19+
import net.minecraft.server.MinecraftServer;
1920
import net.minecraft.util.EnumHand;
2021
import net.minecraft.util.SoundEvent;
2122
import net.minecraft.util.math.BlockPos;
@@ -28,6 +29,7 @@ public interface IComputerCraftProxy
2829
{
2930
void preInit();
3031
void init();
32+
void initServer( MinecraftServer server );
3133
boolean isClient();
3234

3335
boolean getGlobalCursorBlink();

0 commit comments

Comments
 (0)