Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/main/java/noppes/npcs/config/ConfigExperimental.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class ConfigExperimental {
public final static String SERVER = "Server";
public static Property ModernGuiSystemProperty;
public static boolean ModernGuiSystem = false;
public static Property LegacyDropProperty;
public static boolean LegacyDrop = false;


public static void init(File configFile) {
Expand All @@ -24,6 +26,8 @@ public static void init(File configFile) {

ModernGuiSystemProperty = config.get(CLIENT, "Experimental Dialog GUI", false, "Enables the new CNPC+ Modern GUI for Dialog and Quest information");
ModernGuiSystem = ModernGuiSystemProperty.getBoolean(false);
LegacyDropProperty = config.get(SERVER, "Use Legacy DropItem for npc", false, "Use Legacy Drop Item for NPCs for compatibility");
LegacyDrop = LegacyDropProperty.getBoolean(false);
} catch (Exception e) {
FMLLog.log(Level.ERROR, e, "CNPC+ has had a problem loading its experimental configuration");
} finally {
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/noppes/npcs/entity/EntityNPCInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
import noppes.npcs.api.handler.data.ILine;
import noppes.npcs.api.item.IItemStack;
import noppes.npcs.client.EntityUtil;
import noppes.npcs.config.ConfigExperimental;
import noppes.npcs.config.ConfigMain;
import noppes.npcs.config.ConfigScript;
import noppes.npcs.constants.EnumAnimation;
Expand Down Expand Up @@ -1539,9 +1540,14 @@ else if ((entity instanceof EntityThrowable))
}
droppedXp = event.expDropped;

if (this.recentlyHit > 0) {
if (ConfigExperimental.LegacyDrop) {
inventory.dropItems(entity, droppedItems);
}
if (this.recentlyHit > 0) {
inventory.dropXp(entity, droppedXp);
if (!ConfigExperimental.LegacyDrop) {
inventory.dropItems(entity, droppedItems);
}
}
Line line = advanced.getKilledLine();
if (line != null)
Expand Down
Loading