From c2bd05eb7348ecdcbbc1bec029959050bba16eb4 Mon Sep 17 00:00:00 2001 From: Justyn Date: Sat, 2 Jul 2016 05:08:56 -0500 Subject: [PATCH 1/4] Update Forge and fix ChatBox message format --- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 4 ++-- .../peripheralsplusplus/tile/TileChatBox.java | 15 +++++++++------ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 7677c39a..0d064787 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ group= "com.austinv11.peripheralsplusplus" // http://maven.apache.org/guides/min archivesBaseName = "Peripherals++" minecraft { - version = "1.8.9-11.15.1.1755" + version = "1.8.9-11.15.1.1902-1.8.9" runDir = "run" // the mappings can be changed at any time, and must be in the following format. @@ -33,7 +33,7 @@ minecraft { // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not allways work. // simply re-run your setup task after changing the mappings to update your workspace. - mappings = "stable_20" + mappings = "stable_22" // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9397848f..845ea664 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Sep 14 12:28:28 PDT 2015 +#Sat Jul 02 04:03:50 CDT 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-all.zip diff --git a/src/main/java/com/austinv11/peripheralsplusplus/tile/TileChatBox.java b/src/main/java/com/austinv11/peripheralsplusplus/tile/TileChatBox.java index fe555670..eddfa77b 100644 --- a/src/main/java/com/austinv11/peripheralsplusplus/tile/TileChatBox.java +++ b/src/main/java/com/austinv11/peripheralsplusplus/tile/TileChatBox.java @@ -11,6 +11,7 @@ import net.minecraft.util.EntityDamageSource; import net.minecraftforge.event.ServerChatEvent; import net.minecraftforge.event.entity.living.LivingDeathEvent; +import net.minecraftforge.event.entity.living.LivingSpawnEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import java.util.ArrayList; @@ -36,7 +37,8 @@ public boolean say(Object[] arguments) throws LuaException { String message = (String) arguments[0]; int range = (int) (double) (Double) arguments[1]; - String label = String.format("[%d,%d,%d]", getPos().getX(), getPos().getY(), getPos().getZ()); + String coords = String.format("[%d,%d,%d]", getPos().getX(), getPos().getY(), getPos().getZ()); + String label = "ChatBox"; if (arguments.length > 2) { if (!(arguments[2] instanceof String)) { @@ -44,7 +46,7 @@ public boolean say(Object[] arguments) throws LuaException { } label = (String) arguments[2]; } - sendChatMessageInRange(message, range > Config.chatBoxMaxRange ? Config.chatBoxMaxRange : range, label); + sendChatMessageInRange(message, range > Config.chatBoxMaxRange ? Config.chatBoxMaxRange : range, label, coords); return true; } @@ -59,7 +61,8 @@ public boolean tell(Object[] arguments) throws LuaException { String recipientName = (String) arguments[0]; String message = (String) arguments[1]; - String label = String.format("[%d,%d,%d]", getPos().getX(), getPos().getY(), getPos().getZ()); + String coords = String.format("[%d,%d,%d]", getPos().getX(), getPos().getY(), getPos().getZ()); + String label = "ChatBox"; if (arguments.length > 2) { if (!(arguments[2] instanceof String)) { @@ -68,7 +71,7 @@ public boolean tell(Object[] arguments) throws LuaException { label = (String) arguments[2]; } - String messageWithLabel = label + " " + message; + String messageWithLabel = coords + "[PM] " + label + ": " + message; EntityPlayer recipient = MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(recipientName); if (recipient != null) { recipient.addChatMessage(new ChatComponentText(messageWithLabel)); @@ -77,8 +80,8 @@ public boolean tell(Object[] arguments) throws LuaException { return false; } - private void sendChatMessageInRange(String message, int range, String label) { - String messageWithLabel = label + " " + message; + private void sendChatMessageInRange(String message, int range, String label, String coords) { + String messageWithLabel = coords + " " + label + ": " + message; List players; if (range >= 0) { From 2a93adf30d7509dcec16b8ec2536870d1d1b60bd Mon Sep 17 00:00:00 2001 From: Justyn Date: Sat, 2 Jul 2016 18:39:43 -0500 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 731988b5..9f753ffc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -PeripheralsPlusPlus [![Build Status](https://drone.io/github.com/austinv11/PeripheralsPlusPlus/status.png)](https://drone.io/github.com/austinv11/PeripheralsPlusPlus/files) +PeripheralsPlusPlus [![Build Status](https://drone.io/github.com/justync7/PeripheralsPlusPlus/status.png)](https://drone.io/github.com/austinv11/PeripheralsPlusPlus/files) =================== ![Logo](http://puu.sh/fB9TB/66231fda96.png) From 84c6a73e1a36becfbd65efd037e7633c7d256a72 Mon Sep 17 00:00:00 2001 From: Justyn Date: Sat, 2 Jul 2016 19:03:31 -0500 Subject: [PATCH 3/4] Add mcversion to archive base name --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 0d064787..6623c426 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ plugins { */ version = "1.4.0" group= "com.austinv11.peripheralsplusplus" // http://maven.apache.org/guides/mini/guide-naming-conventions.html -archivesBaseName = "Peripherals++" +archivesBaseName = "Peripherals++" + mcversion minecraft { version = "1.8.9-11.15.1.1902-1.8.9" From d2904c6b987e4e756029f2db2b58d63cfb608e6d Mon Sep 17 00:00:00 2001 From: Justyn Date: Sat, 2 Jul 2016 19:14:08 -0500 Subject: [PATCH 4/4] Change mcversion to 1.8.9 --- gradle.properties | 1 + 1 file changed, 1 insertion(+) create mode 100644 gradle.properties diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..ef825b4a --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +mcversion = "1.8.9" \ No newline at end of file