Skip to content

Commit

Permalink
Other 1.12 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
derimagia committed Jun 13, 2018
1 parent b770855 commit e955902
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 252 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ root = true
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = tab
indent_style = space
indent_size = 4

[mcmod.info]
indent_size = 2
16 changes: 5 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ buildscript {
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.0'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
}
}

//plugins {
// id 'com.gradle.build-scan' version '1.12.1'
//}

apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'java'

targetCompatibility = sourceCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -27,18 +23,16 @@ repositories {
maven { url = "https://jitpack.io" }
}

buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
}

minecraft {
version = "1.12.2-14.23.2.2611"
runDir = "run"

// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
mappings = "snapshot_20171003"

replaceIn "ForgeSlack.java"
replace "@VERSION@", project.version
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.parallel=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Feb 19 02:46:01 EST 2018
#Tue Mar 20 19:18:30 EDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
15 changes: 4 additions & 11 deletions src/main/java/com/derimagia/forgeslack/ForgeSlack.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
import net.minecraftforge.fml.common.event.FMLServerStoppedEvent;
import org.apache.logging.log4j.Logger;

import java.io.File;

@Mod(modid = ForgeSlack.modId, useMetadata=true, acceptableRemoteVersions = "*", guiFactory = "com.derimagia.forgeslack.client.gui.ForgeSlackConfigGuiFactory")
@Mod(modid = ForgeSlack.modId, version=ForgeSlack.version, useMetadata=true, acceptableRemoteVersions = "*", canBeDeactivated=true)
public class ForgeSlack {
public static final String modId = "forgeslack";
public static final String version = "@VERSION@";

public static Logger logger;
private static SlackRelay slackRelay;
Expand All @@ -35,11 +34,6 @@ public void preInit(FMLPreInitializationEvent event) {
}
}

// @Mod.EventHandler
// public void postInit(FMLPostInitializationEvent evt)
// {
// ForgeSlackConfig.sync();
// }

@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event) {
Expand All @@ -48,7 +42,7 @@ public void serverStarting(FMLServerStartingEvent event) {
slackRelay.startup();
}
}

@Mod.EventHandler
public void serverStopped(FMLServerStoppedEvent event) {
if (enabled) {
Expand All @@ -60,8 +54,7 @@ public void serverStopped(FMLServerStoppedEvent event) {
/**
* Sync the config.
*/
private static void syncConfig()
{
private static void syncConfig() {
enabled = config.getBoolean("enabled", Configuration.CATEGORY_GENERAL, true, "Whether ForgeSlack is enabled.");
slackToken = config.getString("slackToken", Configuration.CATEGORY_GENERAL, "", "Token Slack provides to Accept Slack Messages");
channel = config.getString("channel", Configuration.CATEGORY_GENERAL, "#general", "Slack Channel to Listen/Send on");
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.derimagia.forgeslack.handler;

import com.derimagia.forgeslack.ForgeSlack;
import com.derimagia.forgeslack.slack.SlackRelay;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.scoreboard.ScorePlayerTeam;
import net.minecraftforge.common.util.FakePlayer;
Expand Down Expand Up @@ -33,7 +32,7 @@ public void onLeave(PlayerEvent.PlayerLoggedOutEvent event) {

@SubscribeEvent
public void onLivingDeath(LivingDeathEvent event) {
if (event.getEntity() instanceof EntityPlayer && !(event.getEntityLiving() instanceof FakePlayer) && !event.getEntity().world.isRemote) {
if (event.getEntity() instanceof EntityPlayer && !(event.getEntityLiving() instanceof FakePlayer) && !event.getEntity().world.isRemote) {
ForgeSlack.getSlackRelay().sendMessage("_" + ((EntityPlayer) event.getEntity()).getCombatTracker().getDeathMessage().getUnformattedText() + "_", (EntityPlayer) event.getEntity());
}
}
Expand Down
Loading

0 comments on commit e955902

Please sign in to comment.