Skip to content

Commit

Permalink
update to artifactory
Browse files Browse the repository at this point in the history
  • Loading branch information
dries007 committed Sep 7, 2014
1 parent 8e6ab7e commit 7dee8c6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
7 changes: 4 additions & 3 deletions build.gradle
Expand Up @@ -90,11 +90,12 @@ idea {
}

uploadArchives {
String repo = "/var/www/ddd/maven/";
if (new File(repo).exists()) {
if (project.hasProperty("dddUser") && project.hasProperty("dddPass")) {
repositories {
mavenDeployer {
repository(url: "file://localhost" + repo)
repository(url: "http://doubledoordev.net:8081/artifactory/mods") {
authentication(userName: dddUser, password: dddPass)
}
pom {
groupId = project.group
version = project.minecraft.version + "-" + project.version
Expand Down
12 changes: 1 addition & 11 deletions src/main/java/net/doubledoordev/d3core/D3Core.java
Expand Up @@ -47,7 +47,6 @@
import net.doubledoordev.d3core.util.DevPerks;
import net.doubledoordev.d3core.util.ID3Mod;
import net.minecraft.util.IChatComponent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.common.config.Configuration;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -187,16 +186,7 @@ public void syncConfig()
debug = configuration.getBoolean("debug", MODID, debug, "Enable debug mode", "d3.core.config.debug");
sillyness = configuration.getBoolean("sillyness", MODID, sillyness, "Enable sillyness\nBut seriously, you can disable name changes, drops and block helmets with this setting.", "d3.core.config.sillyness");
updateWarning = configuration.getBoolean("updateWarning", MODID, updateWarning, "Allow update warnings on login", "d3.core.config.updateWarning");

try
{
if (sillyness) MinecraftForge.EVENT_BUS.register(getDevPerks());
else MinecraftForge.EVENT_BUS.unregister(getDevPerks());
}
catch (NullPointerException e)
{
// Noop. Forge, fix your shit :p
}
getDevPerks().update(sillyness);

if (configuration.hasChanged()) configuration.save();
}
Expand Down
26 changes: 25 additions & 1 deletion src/main/java/net/doubledoordev/d3core/util/DevPerks.java
Expand Up @@ -32,12 +32,14 @@

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameData;
import net.doubledoordev.d3core.D3Core;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import org.apache.commons.io.IOUtils;
Expand Down Expand Up @@ -95,7 +97,7 @@ public void nameFormatEvent(PlayerEvent.NameFormat event)
}

@SubscribeEvent
public void nameFormatEvent(PlayerEvent.Clone event)
public void cloneEvent(PlayerEvent.Clone event)
{
try
{
Expand Down Expand Up @@ -142,4 +144,26 @@ public void deathEvent(PlayerDropsEvent event)
if (D3Core.debug()) e.printStackTrace();
}
}

public void update(boolean sillyness)
{
try
{
if (sillyness) MinecraftForge.EVENT_BUS.register(this);
else MinecraftForge.EVENT_BUS.unregister(this);
}
catch (Exception e)
{
if (D3Core.debug()) e.printStackTrace();
}
try
{
if (sillyness) FMLCommonHandler.instance().bus().register(this);
else FMLCommonHandler.instance().bus().unregister(this);
}
catch (Exception e)
{
if (D3Core.debug()) e.printStackTrace();
}
}
}

0 comments on commit 7dee8c6

Please sign in to comment.