mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-23 20:39:39 +00:00
Reformat Code
This commit is contained in:
1 parent
21e920426e
commit
1de1c4e710
169 files changed
+3967
-1556
No files matched your search
@@ -22,14 +22,17 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
@@ -364,6 +367,7 @@ public class AnimationController implements IAnimationHandler {
|
||||
|
||||
/**
|
||||
* Get a built-in animation by name.
|
||||
*
|
||||
* @param name The animation name (case-insensitive)
|
||||
* @return The built-in animation, or null if not found
|
||||
*/
|
||||
@@ -395,6 +399,7 @@ public class AnimationController implements IAnimationHandler {
|
||||
|
||||
/**
|
||||
* Check if an animation name is a built-in animation.
|
||||
*
|
||||
* @param name The animation name to check
|
||||
* @return true if this is a built-in animation
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import noppes.npcs.config.ConfigMarket;
|
||||
/**
|
||||
* Server-side utility for syncing auction configuration to clients.
|
||||
* Handles Vault integration for currency name resolution.
|
||||
*
|
||||
* <p>
|
||||
* This class is SERVER-SIDE ONLY. Client reads via AuctionClientConfig.
|
||||
*/
|
||||
public class AuctionConfigSync {
|
||||
@@ -15,7 +15,7 @@ public class AuctionConfigSync {
|
||||
/**
|
||||
* Write auction config to NBT for sending to client.
|
||||
* Called on server side when building login packet.
|
||||
*
|
||||
* <p>
|
||||
* Currency name is resolved from Vault if enabled and available,
|
||||
* otherwise falls back to ConfigMarket.CurrencyName.
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
@@ -23,12 +22,12 @@ import noppes.npcs.constants.EnumAuctionSort;
|
||||
import noppes.npcs.constants.EnumAuctionStatus;
|
||||
import noppes.npcs.constants.EnumClaimType;
|
||||
import noppes.npcs.constants.EnumNotificationType;
|
||||
import noppes.npcs.controllers.data.PlayerDataScript;
|
||||
import noppes.npcs.controllers.data.AuctionBlacklist;
|
||||
import noppes.npcs.controllers.data.AuctionClaim;
|
||||
import noppes.npcs.controllers.data.AuctionFilter;
|
||||
import noppes.npcs.controllers.data.AuctionListing;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.PlayerDataScript;
|
||||
import noppes.npcs.controllers.data.PlayerTradeData;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.event.player.AuctionEvent;
|
||||
@@ -37,18 +36,23 @@ import noppes.npcs.util.CustomNPCsThreader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* Main controller for the Auction system.
|
||||
*
|
||||
* <p>
|
||||
* Thread Safety:
|
||||
* - Uses ConcurrentHashMap for all data stores - no locking required
|
||||
* - Claims are stored in PlayerData, not here - reduces contention
|
||||
* - Saves are performed asynchronously on the CNPC+ thread
|
||||
*
|
||||
* <p>
|
||||
* Performance:
|
||||
* - Auction processing runs every 30 seconds (600 ticks)
|
||||
* - Save interval is every 30 seconds (600 ticks)
|
||||
@@ -65,29 +69,41 @@ public class AuctionController implements IAuctionHandler {
|
||||
// Player Indices for O(1) Lookups
|
||||
// =========================================
|
||||
|
||||
/** Listings by seller UUID - for quick "my listings" lookups */
|
||||
/**
|
||||
* Listings by seller UUID - for quick "my listings" lookups
|
||||
*/
|
||||
private final Map<UUID, Set<String>> playerListingIds = new ConcurrentHashMap<>();
|
||||
|
||||
/** Listings where player is current high bidder */
|
||||
/**
|
||||
* Listings where player is current high bidder
|
||||
*/
|
||||
private final Map<UUID, Set<String>> playerBidIds = new ConcurrentHashMap<>();
|
||||
|
||||
/** Cached max trade slots per player - computed on login, cleared on logout */
|
||||
/**
|
||||
* Cached max trade slots per player - computed on login, cleared on logout
|
||||
*/
|
||||
private final Map<UUID, Integer> playerMaxTradesCache = new ConcurrentHashMap<>();
|
||||
|
||||
// =========================================
|
||||
// Threading & State
|
||||
// =========================================
|
||||
|
||||
/** Flag indicating data needs to be saved */
|
||||
/**
|
||||
* Flag indicating data needs to be saved
|
||||
*/
|
||||
private final AtomicBoolean dirty = new AtomicBoolean(false);
|
||||
|
||||
/** Flag to prevent concurrent saves */
|
||||
/**
|
||||
* Flag to prevent concurrent saves
|
||||
*/
|
||||
private final AtomicBoolean saving = new AtomicBoolean(false);
|
||||
|
||||
private String filePath = "";
|
||||
private int tickCounter = 0;
|
||||
|
||||
/** Process auctions and save every 30 seconds (600 ticks) */
|
||||
/**
|
||||
* Process auctions and save every 30 seconds (600 ticks)
|
||||
*/
|
||||
private static final int TICK_INTERVAL = 600;
|
||||
|
||||
public AuctionController() {
|
||||
@@ -375,7 +391,7 @@ public class AuctionController implements IAuctionHandler {
|
||||
|
||||
logAuction(EnumAuctionLogAction.CANCELLED, listing.sellerName, listing.item.getDisplayName(), listing.currentBid,
|
||||
"Penalty: " + penalty + ", Bidder refunded: " + listing.highBidderName +
|
||||
(isAdmin ? ", Cancelled by admin: " + player.getCommandSenderName() : ""));
|
||||
(isAdmin ? ", Cancelled by admin: " + player.getCommandSenderName() : ""));
|
||||
} else {
|
||||
// No bids - just return item
|
||||
AuctionClaim itemClaim = AuctionClaim.createItemReturnedClaim(
|
||||
@@ -1126,12 +1142,16 @@ public class AuctionController implements IAuctionHandler {
|
||||
// Save / Load - Async on CNPC+ Thread
|
||||
// =========================================
|
||||
|
||||
/** Mark data as dirty - will be saved on next save cycle */
|
||||
/**
|
||||
* Mark data as dirty - will be saved on next save cycle
|
||||
*/
|
||||
private void markDirty() {
|
||||
dirty.set(true);
|
||||
}
|
||||
|
||||
/** Save synchronously - used for server shutdown */
|
||||
/**
|
||||
* Save synchronously - used for server shutdown
|
||||
*/
|
||||
public void save() {
|
||||
if (!dirty.compareAndSet(true, false)) {
|
||||
return; // Nothing to save
|
||||
@@ -1139,7 +1159,9 @@ public class AuctionController implements IAuctionHandler {
|
||||
saveInternal();
|
||||
}
|
||||
|
||||
/** Save asynchronously on CNPC+ thread */
|
||||
/**
|
||||
* Save asynchronously on CNPC+ thread
|
||||
*/
|
||||
public void saveAsync() {
|
||||
if (!dirty.compareAndSet(true, false)) {
|
||||
return; // Nothing to save
|
||||
@@ -1167,7 +1189,9 @@ public class AuctionController implements IAuctionHandler {
|
||||
});
|
||||
}
|
||||
|
||||
/** Internal synchronous save */
|
||||
/**
|
||||
* Internal synchronous save
|
||||
*/
|
||||
private void saveInternal() {
|
||||
try {
|
||||
NBTTagCompound compound = writeToNBT(new NBTTagCompound());
|
||||
@@ -1236,7 +1260,9 @@ public class AuctionController implements IAuctionHandler {
|
||||
}
|
||||
}
|
||||
|
||||
/** Rebuild all indices from loaded data */
|
||||
/**
|
||||
* Rebuild all indices from loaded data
|
||||
*/
|
||||
private void rebuildIndices() {
|
||||
playerListingIds.clear();
|
||||
playerBidIds.clear();
|
||||
@@ -1460,8 +1486,8 @@ public class AuctionController implements IAuctionHandler {
|
||||
// Remove ended/cancelled listings (claims are in PlayerData now)
|
||||
listings.entrySet().removeIf(entry ->
|
||||
entry.getValue().status == EnumAuctionStatus.CLAIMED ||
|
||||
entry.getValue().status == EnumAuctionStatus.ENDED ||
|
||||
entry.getValue().status == EnumAuctionStatus.CANCELLED);
|
||||
entry.getValue().status == EnumAuctionStatus.ENDED ||
|
||||
entry.getValue().status == EnumAuctionStatus.CANCELLED);
|
||||
|
||||
// Rebuild indices
|
||||
rebuildIndices();
|
||||
|
||||
@@ -5,7 +5,7 @@ import noppes.npcs.config.ConfigScript;
|
||||
|
||||
/**
|
||||
* Server-side utility for syncing script configuration to clients.
|
||||
*
|
||||
* <p>
|
||||
* This class is SERVER-SIDE ONLY. Client reads via ScriptClientConfig.
|
||||
*/
|
||||
public class ScriptConfigSync {
|
||||
|
||||
@@ -3,12 +3,11 @@ package noppes.npcs.controllers;
|
||||
import noppes.npcs.api.event.IAbilityEvent;
|
||||
import noppes.npcs.api.event.IAnimationEvent;
|
||||
import noppes.npcs.api.event.IAuctionEvent;
|
||||
import noppes.npcs.api.event.IEnergyBarrierEvent;
|
||||
import noppes.npcs.api.event.IPlayerAbilityEvent;
|
||||
import noppes.npcs.api.event.IBlockEvent;
|
||||
import noppes.npcs.api.event.ICustomGuiEvent;
|
||||
import noppes.npcs.api.event.ICustomNPCsEvent;
|
||||
import noppes.npcs.api.event.IDialogEvent;
|
||||
import noppes.npcs.api.event.IEnergyBarrierEvent;
|
||||
import noppes.npcs.api.event.IEnergyProjectileEvent;
|
||||
import noppes.npcs.api.event.IFactionEvent;
|
||||
import noppes.npcs.api.event.IForgeEvent;
|
||||
@@ -16,6 +15,7 @@ import noppes.npcs.api.event.IItemEvent;
|
||||
import noppes.npcs.api.event.ILinkedItemEvent;
|
||||
import noppes.npcs.api.event.INpcEvent;
|
||||
import noppes.npcs.api.event.IPartyEvent;
|
||||
import noppes.npcs.api.event.IPlayerAbilityEvent;
|
||||
import noppes.npcs.api.event.IPlayerEvent;
|
||||
import noppes.npcs.api.event.IProjectileEvent;
|
||||
import noppes.npcs.api.event.IQuestEvent;
|
||||
|
||||
@@ -10,10 +10,10 @@ import noppes.npcs.config.ConfigMarket;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class AuctionBlacklist {
|
||||
private static volatile Set<String> blacklistedItems = new HashSet<>();
|
||||
|
||||
@@ -33,7 +33,9 @@ public class AuctionClaim implements IAuctionClaim {
|
||||
this.otherPlayerName = "";
|
||||
}
|
||||
|
||||
/** Create claim for winning an item (buyer won auction or buyout) */
|
||||
/**
|
||||
* Create claim for winning an item (buyer won auction or buyout)
|
||||
*/
|
||||
public static AuctionClaim createItemWonClaim(UUID playerUUID, String playerName, String listingId, ItemStack item) {
|
||||
AuctionClaim claim = new AuctionClaim();
|
||||
claim.playerUUID = playerUUID;
|
||||
@@ -46,7 +48,9 @@ public class AuctionClaim implements IAuctionClaim {
|
||||
return claim;
|
||||
}
|
||||
|
||||
/** Create claim for returned item (seller's expired/cancelled listing) */
|
||||
/**
|
||||
* Create claim for returned item (seller's expired/cancelled listing)
|
||||
*/
|
||||
public static AuctionClaim createItemReturnedClaim(UUID playerUUID, String playerName, String listingId, ItemStack item) {
|
||||
AuctionClaim claim = new AuctionClaim();
|
||||
claim.playerUUID = playerUUID;
|
||||
@@ -59,7 +63,9 @@ public class AuctionClaim implements IAuctionClaim {
|
||||
return claim;
|
||||
}
|
||||
|
||||
/** Create claim for seller's proceeds (stores item name for tooltip, not full item) */
|
||||
/**
|
||||
* Create claim for seller's proceeds (stores item name for tooltip, not full item)
|
||||
*/
|
||||
public static AuctionClaim createCurrencyClaim(UUID playerUUID, String playerName, String listingId, long currency, String itemName, String buyerName) {
|
||||
AuctionClaim claim = new AuctionClaim();
|
||||
claim.playerUUID = playerUUID;
|
||||
@@ -74,7 +80,9 @@ public class AuctionClaim implements IAuctionClaim {
|
||||
return claim;
|
||||
}
|
||||
|
||||
/** Create claim for outbid refund (stores item for display and rebid option) */
|
||||
/**
|
||||
* Create claim for outbid refund (stores item for display and rebid option)
|
||||
*/
|
||||
public static AuctionClaim createRefundClaim(UUID playerUUID, String playerName, String listingId, long currency, String itemName, String outbidderName, ItemStack item) {
|
||||
AuctionClaim claim = new AuctionClaim();
|
||||
claim.playerUUID = playerUUID;
|
||||
|
||||
@@ -25,14 +25,18 @@ public class AuctionFilter {
|
||||
return searchText != null && !searchText.trim().isEmpty();
|
||||
}
|
||||
|
||||
/** Normalize string for search (strip colors, lowercase, trim) */
|
||||
/**
|
||||
* Normalize string for search (strip colors, lowercase, trim)
|
||||
*/
|
||||
public static String normalizeForSearch(String input) {
|
||||
if (input == null || input.isEmpty()) return "";
|
||||
String stripped = EnumChatFormatting.getTextWithoutFormattingCodes(input);
|
||||
return stripped != null ? stripped.toLowerCase().trim() : input.toLowerCase().trim();
|
||||
}
|
||||
|
||||
/** Check if item name or seller name matches search text */
|
||||
/**
|
||||
* Check if item name or seller name matches search text
|
||||
*/
|
||||
public boolean matchesSearch(String itemName, String sellerName) {
|
||||
if (!hasSearchText()) return true;
|
||||
String normalizedItem = normalizeForSearch(itemName);
|
||||
@@ -41,12 +45,16 @@ public class AuctionFilter {
|
||||
return normalizedItem.contains(normalizedSearch) || normalizedSeller.contains(normalizedSearch);
|
||||
}
|
||||
|
||||
/** Legacy method - only checks item name */
|
||||
/**
|
||||
* Legacy method - only checks item name
|
||||
*/
|
||||
public boolean matchesSearch(String itemName) {
|
||||
return matchesSearch(itemName, "");
|
||||
}
|
||||
|
||||
/** Advanced search - all words must be present in item name OR seller name */
|
||||
/**
|
||||
* Advanced search - all words must be present in item name OR seller name
|
||||
*/
|
||||
public boolean matchesSearchAdvanced(String itemName, String sellerName) {
|
||||
if (!hasSearchText()) return true;
|
||||
String normalizedItem = normalizeForSearch(itemName);
|
||||
@@ -63,7 +71,9 @@ public class AuctionFilter {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Legacy method - only checks item name */
|
||||
/**
|
||||
* Legacy method - only checks item name
|
||||
*/
|
||||
public boolean matchesSearchAdvanced(String itemName) {
|
||||
return matchesSearchAdvanced(itemName, "");
|
||||
}
|
||||
@@ -101,13 +111,20 @@ public class AuctionFilter {
|
||||
}
|
||||
|
||||
// Getters and setters
|
||||
public String getSearchText() { return searchText; }
|
||||
public String getSearchText() {
|
||||
return searchText;
|
||||
}
|
||||
|
||||
public void setSearchText(String searchText) {
|
||||
this.searchText = searchText;
|
||||
this.normalizedSearch = normalizeForSearch(searchText);
|
||||
}
|
||||
|
||||
public EnumAuctionSort getSortBy() { return sortBy; }
|
||||
public void setSortBy(EnumAuctionSort sortBy) { this.sortBy = sortBy; }
|
||||
public EnumAuctionSort getSortBy() {
|
||||
return sortBy;
|
||||
}
|
||||
|
||||
public void setSortBy(EnumAuctionSort sortBy) {
|
||||
this.sortBy = sortBy;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ public class BuiltInAnimation extends Animation {
|
||||
|
||||
/**
|
||||
* Built-in animations cannot be saved.
|
||||
*
|
||||
* @return this animation unchanged
|
||||
*/
|
||||
@Override
|
||||
@@ -33,6 +34,7 @@ public class BuiltInAnimation extends Animation {
|
||||
|
||||
/**
|
||||
* Built-in animations have no valid ID.
|
||||
*
|
||||
* @return always -1
|
||||
*/
|
||||
@Override
|
||||
@@ -50,6 +52,7 @@ public class BuiltInAnimation extends Animation {
|
||||
|
||||
/**
|
||||
* Check if this is a built-in animation.
|
||||
*
|
||||
* @return always true for BuiltInAnimation
|
||||
*/
|
||||
public boolean isBuiltIn() {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityPhase;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbility;
|
||||
import kamkeel.npcs.controllers.data.ability.IAbilityAction;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityGuard;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphInstance;
|
||||
import kamkeel.npcs.network.packets.data.ability.PlayerAbilityStatePacket;
|
||||
import kamkeel.npcs.network.packets.data.ability.PlayerAbilitySyncPacket;
|
||||
import kamkeel.npcs.network.packets.data.telegraph.TelegraphRemovePacket;
|
||||
import kamkeel.npcs.network.packets.data.telegraph.TelegraphSpawnPacket;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -17,17 +19,14 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import noppes.npcs.AbstractDataAbilities;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.EventHooks;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.api.ability.IPlayerAbilityData;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.event.player.PlayerAbilityEvent;
|
||||
|
||||
import kamkeel.npcs.network.packets.data.ability.PlayerAbilityStatePacket;
|
||||
import kamkeel.npcs.network.packets.data.ability.PlayerAbilitySyncPacket;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -152,7 +151,7 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA
|
||||
|
||||
@Override
|
||||
protected void fireInterruptEvent(Ability ability, EntityLivingBase target,
|
||||
DamageSource source, float damage) {
|
||||
DamageSource source, float damage) {
|
||||
EntityPlayer player = playerData.player;
|
||||
if (ScriptController.Instance == null || player == null) return;
|
||||
PlayerDataScript handler = ScriptController.Instance.getPlayerScripts(player);
|
||||
@@ -310,7 +309,9 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA
|
||||
return activateAbility(player, key);
|
||||
}
|
||||
|
||||
/** Prefix used to identify chained ability keys in the unlocked list. */
|
||||
/**
|
||||
* Prefix used to identify chained ability keys in the unlocked list.
|
||||
*/
|
||||
public static final String CHAIN_PREFIX = "chain:";
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,13 +18,13 @@ import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.api.ability.IPlayerAbilityData;
|
||||
import noppes.npcs.api.entity.ICustomNpc;
|
||||
import noppes.npcs.api.handler.IPlayerBankData;
|
||||
import noppes.npcs.api.handler.IPlayerTradeData;
|
||||
import noppes.npcs.api.handler.IPlayerData;
|
||||
import noppes.npcs.api.handler.IPlayerDialogData;
|
||||
import noppes.npcs.api.handler.IPlayerFactionData;
|
||||
import noppes.npcs.api.handler.IPlayerItemGiverData;
|
||||
import noppes.npcs.api.handler.IPlayerMailData;
|
||||
import noppes.npcs.api.handler.IPlayerQuestData;
|
||||
import noppes.npcs.api.handler.IPlayerTradeData;
|
||||
import noppes.npcs.api.handler.IPlayerTransportData;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.EnumRoleType;
|
||||
@@ -47,8 +47,6 @@ import java.io.FileOutputStream;
|
||||
import java.util.HashSet;
|
||||
import java.util.UUID;
|
||||
|
||||
import static noppes.npcs.util.CustomNPCsThreader.customNPCThread;
|
||||
|
||||
public class PlayerData implements IExtendedEntityProperties, IPlayerData {
|
||||
public PlayerDialogData dialogData = new PlayerDialogData(this);
|
||||
public PlayerBankData bankData = new PlayerBankData(this);
|
||||
|
||||
@@ -345,10 +345,10 @@ public class Action implements IAction {
|
||||
try {
|
||||
onStart.accept(this);
|
||||
} catch (Throwable t) {
|
||||
String err = "IAction" + getName() + " onStart threw an exception:";
|
||||
String err = "IAction" + getName() + " onStart threw an exception:";
|
||||
if (reportTo != null)
|
||||
reportTo.appendConsole(err + "\n" + ExceptionUtils.getStackTrace(t));
|
||||
|
||||
|
||||
manager.LOGGER.error("onStart Task of " + this + " threw an exception:", t);
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ public class Action implements IAction {
|
||||
try {
|
||||
onDone.accept(this);
|
||||
} catch (Throwable t) {
|
||||
String err = "IAction" + getName() + " onDone threw an exception:";
|
||||
String err = "IAction" + getName() + " onDone threw an exception:";
|
||||
if (reportTo != null)
|
||||
reportTo.appendConsole(err + "\n" + ExceptionUtils.getStackTrace(t));
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ public class ConditionalAction extends Action implements IConditionalAction {
|
||||
String err = "IConditionalAction '" + getName() + "' threw an exception:";
|
||||
if (reportTo != null)
|
||||
reportTo.appendConsole(err + "\n" + ExceptionUtils.getStackTrace(t));
|
||||
|
||||
|
||||
manager.LOGGER.error("Task of " + this + " threw an exception:", t);
|
||||
markDone();
|
||||
}
|
||||
@@ -151,7 +151,7 @@ public class ConditionalAction extends Action implements IConditionalAction {
|
||||
try {
|
||||
onTermination.accept(this);
|
||||
} catch (Throwable t) {
|
||||
String err = "IConditionalAction" + getName() + " onTermination threw an exception:";
|
||||
String err = "IConditionalAction" + getName() + " onTermination threw an exception:";
|
||||
if (reportTo != null)
|
||||
reportTo.appendConsole(err + "\n" + ExceptionUtils.getStackTrace(t));
|
||||
|
||||
|
||||
Reference in new issue
Block a user