diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
new file mode 100644
index 000000000..80d8a5906
--- /dev/null
+++ b/.github/workflows/gradle.yml
@@ -0,0 +1,25 @@
+name: Java CI with Gradle
+
+on: [push, pull_request]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.8
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
+ - name: Build with Gradle
+ run: ./gradlew SetupCIWorkspace build
+ - name: Build with Gradle (nomixin)
+ run: ./gradlew build -Pnomixin
+ - uses: actions/upload-artifact@v2
+ with:
+ name: Package
+ path: build/libs
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 29bbc6b88..f87f9c2a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ eclipse
bin
.metadata
*.bak
+classes
diff --git a/README.md b/README.md
index 84a04e02f..7bfd6a8ee 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,14 @@
> CustomNPC+ is a [Minecraft](https://minecraft.net/) mod that allows you to add custom NPCs to your world. It is developed for creative and storytelling players who want to make their Minecraft worlds more in-depth and unique. CustomNPC+ is only a branch version of the **1.7.10** Forge version of the original (down below) and has no plans to add or update any other version. This is not an official version of CustomNPC.
-Link to CurseForge: [HERE](https://www.curseforge.com/minecraft/mc-mods/customnpc-plus)
+**CurseForge**: [Download](https://www.curseforge.com/minecraft/mc-mods/customnpc-plus)
+
+[](https://discord.gg/pQqRTvFeJ5)
+[](https://www.curseforge.com/minecraft/mc-mods/customnpc-plus)
+[](https://www.curseforge.com/minecraft/mc-mods/moreplayermodels-plus)
+[](https://github.com/KAMKEEL/Plugin-Mod)
+
+
### âť— Notice
I am not the original creator of CustomNPC. The original creator is @[Noppes](https://github.com/Noppes). I have been permitted to update the 1.7.10 and post my results on GitHub. The original mod that is updated to the latest versions of Minecraft can be found on these links: [CurseForge](https://www.curseforge.com/minecraft/mc-mods/custom-npcs), [kodevelopment](http://www.kodevelopment.nl/minecraft/customnpcs)
@@ -31,17 +38,16 @@ This mod is an ***update*** to CustomNPC and not an add-on. Do not install Custo
- Custom Part Disabling
- Markov Name Generator
- Flying NPCS
+- Dark Mode (Link down below)
#### Scripting:
+- Java Doc: [kamkeel.github.io/CustomNPC-Plus](https://kamkeel.github.io/CustomNPC-Plus/)
- Scripted Items
- Player Overlays
- GUI Overlays
-- Scripting Fixes / New Functions: [Documentation](https://github.com/PewDizinho/CustomNPCPlus-Script-Documentation)
+- Scripting Fixes / New Functions: [Documentation History](https://github.com/PewDizinho/CustomNPCPlus-Script-Documentation)
(We never remove script functionality, only add on existing functions)
---- Please Suggest New Features!
-
-
## đź”° Skin Model Feature:
###### **Majority of these cape designs are taken from the internet with fair-usage.*
##### âť” Please note all *local* skins in this version of CustomNPC, must match the model selected.
@@ -55,17 +61,19 @@ This mod is an ***update*** to CustomNPC and not an add-on. Do not install Custo
## đź”— Want to check out my other projects?
-[MorePlayerModels+](https://github.com/KAMKEEL/MorePlayerModels-Plus) is a continuation on the 1.7.10 MorePlayerModels version. It is not intended to be as polished as CustomNPC+. It will feature Alex, Steve64x64 skins. Hiding Body Parts. Advanced URL Selector. 3D Skins.
-
[Plugin Mod](https://github.com/KAMKEEL/Plugin-Mod) is a mod designed to add more aesthetic items for RPG and storytelling. It is compatible with CustomNPC+ and has many items intended to be used and wielded by created NPCs.
[RPG Messenger](https://github.com/KAMKEEL/RPGMessenger) is a bukkit plugin designed to allow operators to create messagable NPCs for RPG Servers. Allows a 'RPG Controller' to reply quickly as NPCs, form groupchats, and messagable parties.
[CustomNPC+ Dark Mode](https://github.com/KAMKEEL/CustomNPC-Plus-Dark-Mode) is a resource pack for CustomNPC+ that alters all GUIs within the mod to a dark variant that is both clean and pleasing to look at.
-[](https://discord.gg/rgeWsmQaKa)
-[](https://discord.gg/pQqRTvFeJ5)
-[](https://www.curseforge.com/minecraft/mc-mods/customnpc-plus)
-[](https://github.com/KAMKEEL/Plugin-Mod)
-
+## Compiling / Building
+Using IntelliJ, take the following steps:
+1. Run `setupDecompWorkspace` under the `forgegradle` tab.
+2. Refresh Gradle.
+3. Run `genIntellijRuns` under the `other` tab to set up your Minecraft runs.
+
+or for Eclipse, run `gradlew setupDecompWorkspace eclipse` then import the project.
+
+Mixin code will not work if you do not add `--tweakClass org.spongepowered.asm.launch.MixinTweaker --mixin customnpcs.mixins.json` to your program arguments.
diff --git a/build.gradle b/build.gradle
index 0545ee9da..5c1774d68 100644
--- a/build.gradle
+++ b/build.gradle
@@ -24,7 +24,7 @@ configurations {
apply plugin: 'forge'
-version = "1.6.2-pre2"
+version = "1.6.4"
group= "com.kamkeel.customnpc-plus" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "CustomNPC-Plus"
@@ -87,9 +87,15 @@ jar {
//Add
//--tweakClass org.spongepowered.asm.launch.MixinTweaker --mixin customnpcs.mixins.json
//to your client and server program arguments if working in a dev environment.
+def embedMixin = !project.hasProperty("nomixin");
def yourMixinConfig = 'customnpcs.mixins.json'
def refMapForYourConfig = 'customnpcs.refmap.json'
def relativePathToMixinAP = 'tools/mixin-0.8-SNAPSHOT.jar'
+
+if(!embedMixin){
+ version += "+nomixin"
+}
+
repositories {
maven {
name = "sponge"
@@ -98,13 +104,24 @@ repositories {
}
dependencies {
- embed('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
- // Mixin includes a lot of dependencies that are too up-to-date
- exclude module: 'launchwrapper'
- exclude module: 'guava'
- exclude module: 'gson'
- exclude module: 'commons-io'
- exclude module: 'log4j-core'
+ if(embedMixin){
+ embed('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
+ // Mixin includes a lot of dependencies that are too up-to-date
+ exclude module: 'launchwrapper'
+ exclude module: 'guava'
+ exclude module: 'gson'
+ exclude module: 'commons-io'
+ exclude module: 'log4j-core'
+ }
+ } else {
+ implementation('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
+ // Mixin includes a lot of dependencies that are too up-to-date
+ exclude module: 'launchwrapper'
+ exclude module: 'guava'
+ exclude module: 'gson'
+ exclude module: 'commons-io'
+ exclude module: 'log4j-core'
+ }
}
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 830c5ccee..e6d7cad24 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
\ No newline at end of file
diff --git a/src/main/java/noppes/npcs/CustomNpcs.java b/src/main/java/noppes/npcs/CustomNpcs.java
index 5de8dc7ac..aa11e469d 100644
--- a/src/main/java/noppes/npcs/CustomNpcs.java
+++ b/src/main/java/noppes/npcs/CustomNpcs.java
@@ -34,7 +34,7 @@ import java.util.ArrayList;
import java.util.Set;
import java.util.UUID;
-@Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.6.2-pre2")
+@Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.6.4")
public class CustomNpcs {
@ConfigProp(info = "Disable Chat Bubbles")
@@ -159,6 +159,9 @@ public class CustomNpcs {
@ConfigProp(info="Font size for custom fonts (doesn't work with minecrafts font)")
public static int FontSize = 18;
+ @ConfigProp(info = "Enables Overlay Mixins for Conflicts relating to Optifine or other Skin Renderers. If crashes occur, please disable.")
+ public static boolean EntityRendererMixin = true;
+
public static FMLEventChannel Channel;
public static FMLEventChannel ChannelPlayer;
diff --git a/src/main/java/noppes/npcs/NoppesUtilPlayer.java b/src/main/java/noppes/npcs/NoppesUtilPlayer.java
index ed6a8f552..6f9696e6d 100644
--- a/src/main/java/noppes/npcs/NoppesUtilPlayer.java
+++ b/src/main/java/noppes/npcs/NoppesUtilPlayer.java
@@ -330,6 +330,9 @@ public class NoppesUtilPlayer {
Server.sendData(player, EnumPacketClient.GUI_DATA, data.writeNBT());
}
public static void questCompletion(EntityPlayerMP player, int questId) {
+ if(player == null)
+ return;
+
PlayerData playerData = PlayerDataController.instance.getPlayerData(player);
PlayerQuestData questData = playerData.questData;
QuestData data = questData.activeQuests.get(questId);
@@ -349,7 +352,10 @@ public class NoppesUtilPlayer {
while(var8.hasNext()) {
ItemStack item = (ItemStack)var8.next();
if (item.stackSize > 0) {
- list.add(NpcAPI.Instance().getIItemStack(item));
+ IItemStack iStack = NpcAPI.Instance().getIItemStack(item);
+ if (iStack != null){
+ list.add(iStack);
+ }
}
}
diff --git a/src/main/java/noppes/npcs/ScriptPlayerEventHandler.java b/src/main/java/noppes/npcs/ScriptPlayerEventHandler.java
index 449e704a1..4b7b6bfe9 100644
--- a/src/main/java/noppes/npcs/ScriptPlayerEventHandler.java
+++ b/src/main/java/noppes/npcs/ScriptPlayerEventHandler.java
@@ -379,8 +379,10 @@ public class ScriptPlayerEventHandler {
Entity source = NoppesUtilServer.GetDamageSourcee(event.source);
PlayerDataScript handler = ScriptController.Instance.playerScripts;
if(event.entityLiving instanceof EntityPlayer) {
- IPlayer scriptPlayer = (IPlayer) NpcAPI.Instance().getIEntity(event.entityLiving);
- EventHooks.onPlayerDeath(handler,scriptPlayer, event.source, source);
+ try {
+ IPlayer scriptPlayer = (IPlayer) NpcAPI.Instance().getIEntity(event.entityLiving);
+ EventHooks.onPlayerDeath(handler,scriptPlayer, event.source, source);
+ } catch (Exception ignored) {}
}
if(source instanceof EntityPlayer) {
diff --git a/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcDisplay.java b/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcDisplay.java
index 41fb6f643..29173463e 100644
--- a/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcDisplay.java
+++ b/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcDisplay.java
@@ -185,6 +185,7 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
}
else if(button.id == 11){
npc.display.skinOverlayData.overlayList.get(0).setGlow(button.getValue() == 0);
+ npc.display.skinOverlayData.overlayList.get(0).setBlend(button.getValue() == 0);
initGui();
}
else if(button.id == 14){
diff --git a/src/main/java/noppes/npcs/client/renderer/RenderNPCHumanMale.java b/src/main/java/noppes/npcs/client/renderer/RenderNPCHumanMale.java
index a2f42a611..ef63d5492 100644
--- a/src/main/java/noppes/npcs/client/renderer/RenderNPCHumanMale.java
+++ b/src/main/java/noppes/npcs/client/renderer/RenderNPCHumanMale.java
@@ -259,7 +259,7 @@ public class RenderNPCHumanMale extends RenderNPCInterface
GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
}
- else if (itemstack2.getItem().isFull3D() && (customRenderer == null || pluginMod))
+ else if (itemstack2.getItem().isFull3D() && !is3D)
{
var6 = 0.625F;
@@ -367,7 +367,7 @@ public class RenderNPCHumanMale extends RenderNPCInterface
GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
}
- else if (itemstack2.getItem().isFull3D())
+ else if (itemstack2.getItem().isFull3D() && !is3D)
{
var6 = 0.625F;
diff --git a/src/main/java/noppes/npcs/items/ItemSoulstoneFilled.java b/src/main/java/noppes/npcs/items/ItemSoulstoneFilled.java
index 4412eb26c..11c21e8e1 100644
--- a/src/main/java/noppes/npcs/items/ItemSoulstoneFilled.java
+++ b/src/main/java/noppes/npcs/items/ItemSoulstoneFilled.java
@@ -77,8 +77,8 @@ public class ItemSoulstoneFilled extends Item {
EntityNPCInterface npc = (EntityNPCInterface) entity;
npc.ai.startPos = new int[]{x, y, z};
npc.setHealth(npc.getMaxHealth());
- npc.setPosition((float)x + 0.5F, npc.getStartYPos(), (float)z + 0.5F);
- npc.advanced.soulStonePlayerName = player.getDisplayName();
+ npc.setPosition((float)x + 0.5F, npc.getStartYPos() - 0.5, (float)z + 0.5F);
+ npc.advanced.soulStonePlayerName = player.getDisplayName();
npc.advanced.soulStoneInit = true;
if(npc.advanced.role == EnumRoleType.Companion && player != null){
PlayerData data = PlayerDataController.instance.getPlayerData(player);
diff --git a/src/main/java/noppes/npcs/mixin/CustomNPCsMixinPlugin.java b/src/main/java/noppes/npcs/mixin/CustomNPCsMixinPlugin.java
index 7173da9dd..630444f5c 100644
--- a/src/main/java/noppes/npcs/mixin/CustomNPCsMixinPlugin.java
+++ b/src/main/java/noppes/npcs/mixin/CustomNPCsMixinPlugin.java
@@ -1,5 +1,6 @@
package noppes.npcs.mixin;
+import noppes.npcs.CustomNpcs;
import org.spongepowered.asm.lib.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
@@ -32,9 +33,9 @@ public class CustomNPCsMixinPlugin implements IMixinConfigPlugin {
@Override
public List getMixins() {
List mixins = new ArrayList<>();
-
- mixins.add("MixinEntityRenderer");
-
+ if (CustomNpcs.EntityRendererMixin){
+ mixins.add("MixinEntityRenderer");
+ }
return mixins;
}