Change class name to fix ghost mod issues.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
classname=mod.sin.armoury.ArmouryMod
|
classname=mod.sin.armoury.ArmouryModMain
|
||||||
classpath=Armoury.jar
|
classpath=Armoury.jar
|
||||||
depend.import=SinduskLibrary
|
depend.import=SinduskLibrary
|
||||||
depend.suggests=ServerTweaks
|
depend.suggests=ServerTweaks
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import java.util.Properties;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
public class ArmouryMod
|
public class ArmouryModMain
|
||||||
implements WurmServerMod, Configurable, PreInitable, ItemTemplatesCreatedListener, ServerStartedListener {
|
implements WurmServerMod, Configurable, PreInitable, ItemTemplatesCreatedListener, ServerStartedListener {
|
||||||
public static Logger logger = Logger.getLogger(ArmouryMod.class.getName());
|
public static Logger logger = Logger.getLogger(ArmouryModMain.class.getName());
|
||||||
|
|
||||||
// Configuration options
|
// Configuration options
|
||||||
public static boolean enableNonPlayerCrits = true;
|
public static boolean enableNonPlayerCrits = true;
|
||||||
@@ -36,8 +36,8 @@ public class CombatTweaks {
|
|||||||
Class<CombatTweaks> thisClass = CombatTweaks.class;
|
Class<CombatTweaks> thisClass = CombatTweaks.class;
|
||||||
|
|
||||||
// - Allow critical hits on creatures as well as players -
|
// - Allow critical hits on creatures as well as players -
|
||||||
ArmouryMod.enableNonPlayerCrits = false; // Disabled for now as it's not working.
|
ArmouryModMain.enableNonPlayerCrits = false; // Disabled for now as it's not working.
|
||||||
if(ArmouryMod.enableNonPlayerCrits){
|
if(ArmouryModMain.enableNonPlayerCrits){
|
||||||
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
|
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
|
||||||
CtClass[] attackParams1 = {
|
CtClass[] attackParams1 = {
|
||||||
classPool.get("com.wurmonline.server.creatures.Creature"),
|
classPool.get("com.wurmonline.server.creatures.Creature"),
|
||||||
@@ -73,16 +73,16 @@ public class CombatTweaks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// - Change the minimum swing timer - //
|
// - Change the minimum swing timer - //
|
||||||
if(ArmouryMod.minimumSwingTime != 3.0f){
|
if(ArmouryModMain.minimumSwingTime != 3.0f){
|
||||||
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
|
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
|
||||||
String strBuilder = "";
|
String strBuilder = "";
|
||||||
if(ArmouryMod.raresReduceSwingTime){
|
if(ArmouryModMain.raresReduceSwingTime){
|
||||||
strBuilder += ""
|
strBuilder += ""
|
||||||
+ "if(weapon.getRarity() > 0){"
|
+ "if(weapon.getRarity() > 0){"
|
||||||
+ " calcspeed -= weapon.getRarity()*"+String.valueOf(ArmouryMod.rareSwingSpeedReduction)+"f;"
|
+ " calcspeed -= weapon.getRarity()*"+String.valueOf(ArmouryModMain.rareSwingSpeedReduction)+"f;"
|
||||||
+ "}";
|
+ "}";
|
||||||
}
|
}
|
||||||
strBuilder += "$_ = $proceed("+String.valueOf(ArmouryMod.minimumSwingTime)+"f, $2);";
|
strBuilder += "$_ = $proceed("+String.valueOf(ArmouryModMain.minimumSwingTime)+"f, $2);";
|
||||||
|
|
||||||
final String stringReplace = strBuilder;
|
final String stringReplace = strBuilder;
|
||||||
CtClass[] params1 = {
|
CtClass[] params1 = {
|
||||||
@@ -115,7 +115,7 @@ public class CombatTweaks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// - Saved swing timer fix -
|
// - Saved swing timer fix -
|
||||||
if(ArmouryMod.fixSavedSwingTimer){
|
if(ArmouryModMain.fixSavedSwingTimer){
|
||||||
CtClass ctCreature = classPool.get("com.wurmonline.server.creatures.Creature");
|
CtClass ctCreature = classPool.get("com.wurmonline.server.creatures.Creature");
|
||||||
String replace = "$_ = $proceed($1, new Float(0f));";
|
String replace = "$_ = $proceed($1, new Float(0f));";
|
||||||
Util.setReason("Fix saved swing timer.");
|
Util.setReason("Fix saved swing timer.");
|
||||||
@@ -132,7 +132,7 @@ public class CombatTweaks {
|
|||||||
|
|
||||||
// - Attempt for a better dual wield system -
|
// - Attempt for a better dual wield system -
|
||||||
// This really doesn't work. I don't get dual wield and why it's so bad.
|
// This really doesn't work. I don't get dual wield and why it's so bad.
|
||||||
if(ArmouryMod.betterDualWield){
|
if(ArmouryModMain.betterDualWield){
|
||||||
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
|
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
|
||||||
CtClass[] params1 = {
|
CtClass[] params1 = {
|
||||||
classPool.get("com.wurmonline.server.creatures.Creature"),
|
classPool.get("com.wurmonline.server.creatures.Creature"),
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ public class MaterialTweaks {
|
|||||||
final Class<MaterialTweaks> thisClass = MaterialTweaks.class;
|
final Class<MaterialTweaks> thisClass = MaterialTweaks.class;
|
||||||
String replace;
|
String replace;
|
||||||
|
|
||||||
if(ArmouryMod.enableItemMaterialChanges){
|
if(ArmouryModMain.enableItemMaterialChanges){
|
||||||
Util.setReason("Enable material damage taken modifications.");
|
Util.setReason("Enable material damage taken modifications.");
|
||||||
CtClass ctItem = classPool.get("com.wurmonline.server.items.Item");
|
CtClass ctItem = classPool.get("com.wurmonline.server.items.Item");
|
||||||
replace = "{"
|
replace = "{"
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class ShieldTweaks {
|
|||||||
try {
|
try {
|
||||||
ClassPool classPool = HookManager.getInstance().getClassPool();
|
ClassPool classPool = HookManager.getInstance().getClassPool();
|
||||||
Class<ShieldTweaks> thisClass = ShieldTweaks.class;
|
Class<ShieldTweaks> thisClass = ShieldTweaks.class;
|
||||||
if(ArmouryMod.enableShieldDamageEnchants){
|
if(ArmouryModMain.enableShieldDamageEnchants){
|
||||||
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
|
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
|
||||||
String replace = ShieldTweaks.class.getName()+".doSharedPain(this.creature, defender, defShield);"
|
String replace = ShieldTweaks.class.getName()+".doSharedPain(this.creature, defender, defShield);"
|
||||||
+ "$_ = $proceed($$);";
|
+ "$_ = $proceed($$);";
|
||||||
@@ -76,7 +76,7 @@ public class ShieldTweaks {
|
|||||||
}
|
}
|
||||||
});*/
|
});*/
|
||||||
}
|
}
|
||||||
if(ArmouryMod.enableShieldSpeedEnchants){
|
if(ArmouryModMain.enableShieldSpeedEnchants){
|
||||||
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
|
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
|
||||||
String insert = "if("+ShieldTweaks.class.getName()+".checkShieldSpeed(defender.getShield())){"
|
String insert = "if("+ShieldTweaks.class.getName()+".checkShieldSpeed(defender.getShield())){"
|
||||||
+ " defender.getCombatHandler().usedShieldThisRound--;"
|
+ " defender.getCombatHandler().usedShieldThisRound--;"
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ public class WeaponTweaks {
|
|||||||
String tweakType;
|
String tweakType;
|
||||||
tweakType = "damage";
|
tweakType = "damage";
|
||||||
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
||||||
for(int id : ArmouryMod.weaponDamage.keySet()){
|
for(int id : ArmouryModMain.weaponDamage.keySet()){
|
||||||
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
||||||
if(it == null){
|
if(it == null){
|
||||||
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid.");
|
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid.");
|
||||||
@@ -173,7 +173,7 @@ public class WeaponTweaks {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
float oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "damage"));
|
float oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "damage"));
|
||||||
float newValue = ArmouryMod.weaponDamage.get(id);
|
float newValue = ArmouryModMain.weaponDamage.get(id);
|
||||||
String diff;
|
String diff;
|
||||||
if(newValue > oldValue){
|
if(newValue > oldValue){
|
||||||
diff = "+"+(newValue-oldValue);
|
diff = "+"+(newValue-oldValue);
|
||||||
@@ -185,7 +185,7 @@ public class WeaponTweaks {
|
|||||||
}
|
}
|
||||||
tweakType = "speed";
|
tweakType = "speed";
|
||||||
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
||||||
for(int id : ArmouryMod.weaponSpeed.keySet()){
|
for(int id : ArmouryModMain.weaponSpeed.keySet()){
|
||||||
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
||||||
if(it == null){
|
if(it == null){
|
||||||
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid. Please double check your configuration.");
|
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid. Please double check your configuration.");
|
||||||
@@ -197,7 +197,7 @@ public class WeaponTweaks {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
float oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "speed"));
|
float oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "speed"));
|
||||||
float newValue = ArmouryMod.weaponSpeed.get(id);
|
float newValue = ArmouryModMain.weaponSpeed.get(id);
|
||||||
String diff;
|
String diff;
|
||||||
if(newValue > oldValue){
|
if(newValue > oldValue){
|
||||||
diff = "+"+(newValue-oldValue);
|
diff = "+"+(newValue-oldValue);
|
||||||
@@ -209,7 +209,7 @@ public class WeaponTweaks {
|
|||||||
}
|
}
|
||||||
tweakType = "crit chance";
|
tweakType = "crit chance";
|
||||||
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
||||||
for(int id : ArmouryMod.weaponCritChance.keySet()){
|
for(int id : ArmouryModMain.weaponCritChance.keySet()){
|
||||||
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
||||||
if(it == null){
|
if(it == null){
|
||||||
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid. Please double check your configuration.");
|
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid. Please double check your configuration.");
|
||||||
@@ -221,7 +221,7 @@ public class WeaponTweaks {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
float oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "critchance"));
|
float oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "critchance"));
|
||||||
float newValue = ArmouryMod.weaponCritChance.get(id);
|
float newValue = ArmouryModMain.weaponCritChance.get(id);
|
||||||
String diff;
|
String diff;
|
||||||
if(newValue > oldValue){
|
if(newValue > oldValue){
|
||||||
diff = "+"+(newValue-oldValue);
|
diff = "+"+(newValue-oldValue);
|
||||||
@@ -233,7 +233,7 @@ public class WeaponTweaks {
|
|||||||
}
|
}
|
||||||
tweakType = "reach";
|
tweakType = "reach";
|
||||||
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
||||||
for(int id : ArmouryMod.weaponReach.keySet()){
|
for(int id : ArmouryModMain.weaponReach.keySet()){
|
||||||
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
||||||
if(it == null){
|
if(it == null){
|
||||||
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid. Please double check your configuration.");
|
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid. Please double check your configuration.");
|
||||||
@@ -245,7 +245,7 @@ public class WeaponTweaks {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "reach"));
|
int oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "reach"));
|
||||||
int newValue = ArmouryMod.weaponReach.get(id);
|
int newValue = ArmouryModMain.weaponReach.get(id);
|
||||||
String diff;
|
String diff;
|
||||||
if(newValue > oldValue){
|
if(newValue > oldValue){
|
||||||
diff = "+"+(newValue-oldValue);
|
diff = "+"+(newValue-oldValue);
|
||||||
@@ -257,7 +257,7 @@ public class WeaponTweaks {
|
|||||||
}
|
}
|
||||||
tweakType = "weight group";
|
tweakType = "weight group";
|
||||||
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
||||||
for(int id : ArmouryMod.weaponWeightGroup.keySet()){
|
for(int id : ArmouryModMain.weaponWeightGroup.keySet()){
|
||||||
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
||||||
if(it == null){
|
if(it == null){
|
||||||
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid. Please double check your configuration.");
|
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid. Please double check your configuration.");
|
||||||
@@ -269,7 +269,7 @@ public class WeaponTweaks {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "weightGroup"));
|
int oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "weightGroup"));
|
||||||
int newValue = ArmouryMod.weaponWeightGroup.get(id);
|
int newValue = ArmouryModMain.weaponWeightGroup.get(id);
|
||||||
String diff;
|
String diff;
|
||||||
if(newValue > oldValue){
|
if(newValue > oldValue){
|
||||||
diff = "+"+(newValue-oldValue);
|
diff = "+"+(newValue-oldValue);
|
||||||
@@ -281,7 +281,7 @@ public class WeaponTweaks {
|
|||||||
}
|
}
|
||||||
tweakType = "parry percent";
|
tweakType = "parry percent";
|
||||||
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
||||||
for(int id : ArmouryMod.weaponParryPercent.keySet()){
|
for(int id : ArmouryModMain.weaponParryPercent.keySet()){
|
||||||
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
||||||
if(it == null){
|
if(it == null){
|
||||||
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid. Please double check your configuration.");
|
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid. Please double check your configuration.");
|
||||||
@@ -293,7 +293,7 @@ public class WeaponTweaks {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
float oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "parryPercent"));
|
float oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "parryPercent"));
|
||||||
float newValue = ArmouryMod.weaponParryPercent.get(id);
|
float newValue = ArmouryModMain.weaponParryPercent.get(id);
|
||||||
String diff;
|
String diff;
|
||||||
if(newValue > oldValue){
|
if(newValue > oldValue){
|
||||||
diff = "+"+(newValue-oldValue);
|
diff = "+"+(newValue-oldValue);
|
||||||
@@ -305,7 +305,7 @@ public class WeaponTweaks {
|
|||||||
}
|
}
|
||||||
tweakType = "skill penalty";
|
tweakType = "skill penalty";
|
||||||
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
logger.info("Beginning weapon "+tweakType+" tweaks...");
|
||||||
for(int id : ArmouryMod.weaponSkillPenalty.keySet()){
|
for(int id : ArmouryModMain.weaponSkillPenalty.keySet()){
|
||||||
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
|
||||||
if(it == null){
|
if(it == null){
|
||||||
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid. Please double check your configuration.");
|
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid. Please double check your configuration.");
|
||||||
@@ -317,7 +317,7 @@ public class WeaponTweaks {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
double oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "skillPenalty"));
|
double oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "skillPenalty"));
|
||||||
double newValue = ArmouryMod.weaponSkillPenalty.get(id);
|
double newValue = ArmouryModMain.weaponSkillPenalty.get(id);
|
||||||
String diff;
|
String diff;
|
||||||
if(newValue > oldValue){
|
if(newValue > oldValue){
|
||||||
diff = "+"+(newValue-oldValue);
|
diff = "+"+(newValue-oldValue);
|
||||||
@@ -368,7 +368,7 @@ public class WeaponTweaks {
|
|||||||
final Class<WeaponTweaks> thisClass = WeaponTweaks.class;
|
final Class<WeaponTweaks> thisClass = WeaponTweaks.class;
|
||||||
String replace;
|
String replace;
|
||||||
|
|
||||||
if(ArmouryMod.enableWeaponMaterialChanges){
|
if(ArmouryModMain.enableWeaponMaterialChanges){
|
||||||
Util.setReason("Enable weapon material damage modifications.");
|
Util.setReason("Enable weapon material damage modifications.");
|
||||||
CtClass ctWeapon = classPool.get("com.wurmonline.server.combat.Weapon");
|
CtClass ctWeapon = classPool.get("com.wurmonline.server.combat.Weapon");
|
||||||
replace = "{"
|
replace = "{"
|
||||||
|
|||||||
Reference in New Issue
Block a user