Change class name to fix ghost mod issues.

This commit is contained in:
Sindusk
2018-09-21 03:29:09 -04:00
parent 82056ece66
commit 3091da69f3
6 changed files with 29 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
classname=mod.sin.armoury.ArmouryMod
classname=mod.sin.armoury.ArmouryModMain
classpath=Armoury.jar
depend.import=SinduskLibrary
depend.suggests=ServerTweaks

View File

@@ -9,9 +9,9 @@ import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
public class ArmouryMod
public class ArmouryModMain
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
public static boolean enableNonPlayerCrits = true;

View File

@@ -36,8 +36,8 @@ public class CombatTweaks {
Class<CombatTweaks> thisClass = CombatTweaks.class;
// - Allow critical hits on creatures as well as players -
ArmouryMod.enableNonPlayerCrits = false; // Disabled for now as it's not working.
if(ArmouryMod.enableNonPlayerCrits){
ArmouryModMain.enableNonPlayerCrits = false; // Disabled for now as it's not working.
if(ArmouryModMain.enableNonPlayerCrits){
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
CtClass[] attackParams1 = {
classPool.get("com.wurmonline.server.creatures.Creature"),
@@ -73,16 +73,16 @@ public class CombatTweaks {
}
// - Change the minimum swing timer - //
if(ArmouryMod.minimumSwingTime != 3.0f){
if(ArmouryModMain.minimumSwingTime != 3.0f){
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
String strBuilder = "";
if(ArmouryMod.raresReduceSwingTime){
if(ArmouryModMain.raresReduceSwingTime){
strBuilder += ""
+ "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;
CtClass[] params1 = {
@@ -115,7 +115,7 @@ public class CombatTweaks {
}
// - Saved swing timer fix -
if(ArmouryMod.fixSavedSwingTimer){
if(ArmouryModMain.fixSavedSwingTimer){
CtClass ctCreature = classPool.get("com.wurmonline.server.creatures.Creature");
String replace = "$_ = $proceed($1, new Float(0f));";
Util.setReason("Fix saved swing timer.");
@@ -132,7 +132,7 @@ public class CombatTweaks {
// - Attempt for a better dual wield system -
// 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[] params1 = {
classPool.get("com.wurmonline.server.creatures.Creature"),

View File

@@ -385,7 +385,7 @@ public class MaterialTweaks {
final Class<MaterialTweaks> thisClass = MaterialTweaks.class;
String replace;
if(ArmouryMod.enableItemMaterialChanges){
if(ArmouryModMain.enableItemMaterialChanges){
Util.setReason("Enable material damage taken modifications.");
CtClass ctItem = classPool.get("com.wurmonline.server.items.Item");
replace = "{"

View File

@@ -60,7 +60,7 @@ public class ShieldTweaks {
try {
ClassPool classPool = HookManager.getInstance().getClassPool();
Class<ShieldTweaks> thisClass = ShieldTweaks.class;
if(ArmouryMod.enableShieldDamageEnchants){
if(ArmouryModMain.enableShieldDamageEnchants){
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
String replace = ShieldTweaks.class.getName()+".doSharedPain(this.creature, defender, defShield);"
+ "$_ = $proceed($$);";
@@ -76,7 +76,7 @@ public class ShieldTweaks {
}
});*/
}
if(ArmouryMod.enableShieldSpeedEnchants){
if(ArmouryModMain.enableShieldSpeedEnchants){
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
String insert = "if("+ShieldTweaks.class.getName()+".checkShieldSpeed(defender.getShield())){"
+ " defender.getCombatHandler().usedShieldThisRound--;"

View File

@@ -161,7 +161,7 @@ public class WeaponTweaks {
String tweakType;
tweakType = "damage";
logger.info("Beginning weapon "+tweakType+" tweaks...");
for(int id : ArmouryMod.weaponDamage.keySet()){
for(int id : ArmouryModMain.weaponDamage.keySet()){
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
if(it == null){
logger.severe("[ERROR]: Item template for id "+id+" in weapon "+tweakType+" configuration is invalid.");
@@ -173,7 +173,7 @@ public class WeaponTweaks {
continue;
}
float oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "damage"));
float newValue = ArmouryMod.weaponDamage.get(id);
float newValue = ArmouryModMain.weaponDamage.get(id);
String diff;
if(newValue > oldValue){
diff = "+"+(newValue-oldValue);
@@ -185,7 +185,7 @@ public class WeaponTweaks {
}
tweakType = "speed";
logger.info("Beginning weapon "+tweakType+" tweaks...");
for(int id : ArmouryMod.weaponSpeed.keySet()){
for(int id : ArmouryModMain.weaponSpeed.keySet()){
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
if(it == null){
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;
}
float oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "speed"));
float newValue = ArmouryMod.weaponSpeed.get(id);
float newValue = ArmouryModMain.weaponSpeed.get(id);
String diff;
if(newValue > oldValue){
diff = "+"+(newValue-oldValue);
@@ -209,7 +209,7 @@ public class WeaponTweaks {
}
tweakType = "crit chance";
logger.info("Beginning weapon "+tweakType+" tweaks...");
for(int id : ArmouryMod.weaponCritChance.keySet()){
for(int id : ArmouryModMain.weaponCritChance.keySet()){
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
if(it == null){
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;
}
float oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "critchance"));
float newValue = ArmouryMod.weaponCritChance.get(id);
float newValue = ArmouryModMain.weaponCritChance.get(id);
String diff;
if(newValue > oldValue){
diff = "+"+(newValue-oldValue);
@@ -233,7 +233,7 @@ public class WeaponTweaks {
}
tweakType = "reach";
logger.info("Beginning weapon "+tweakType+" tweaks...");
for(int id : ArmouryMod.weaponReach.keySet()){
for(int id : ArmouryModMain.weaponReach.keySet()){
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
if(it == null){
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;
}
int oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "reach"));
int newValue = ArmouryMod.weaponReach.get(id);
int newValue = ArmouryModMain.weaponReach.get(id);
String diff;
if(newValue > oldValue){
diff = "+"+(newValue-oldValue);
@@ -257,7 +257,7 @@ public class WeaponTweaks {
}
tweakType = "weight group";
logger.info("Beginning weapon "+tweakType+" tweaks...");
for(int id : ArmouryMod.weaponWeightGroup.keySet()){
for(int id : ArmouryModMain.weaponWeightGroup.keySet()){
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
if(it == null){
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;
}
int oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "weightGroup"));
int newValue = ArmouryMod.weaponWeightGroup.get(id);
int newValue = ArmouryModMain.weaponWeightGroup.get(id);
String diff;
if(newValue > oldValue){
diff = "+"+(newValue-oldValue);
@@ -281,7 +281,7 @@ public class WeaponTweaks {
}
tweakType = "parry percent";
logger.info("Beginning weapon "+tweakType+" tweaks...");
for(int id : ArmouryMod.weaponParryPercent.keySet()){
for(int id : ArmouryModMain.weaponParryPercent.keySet()){
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
if(it == null){
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;
}
float oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "parryPercent"));
float newValue = ArmouryMod.weaponParryPercent.get(id);
float newValue = ArmouryModMain.weaponParryPercent.get(id);
String diff;
if(newValue > oldValue){
diff = "+"+(newValue-oldValue);
@@ -305,7 +305,7 @@ public class WeaponTweaks {
}
tweakType = "skill penalty";
logger.info("Beginning weapon "+tweakType+" tweaks...");
for(int id : ArmouryMod.weaponSkillPenalty.keySet()){
for(int id : ArmouryModMain.weaponSkillPenalty.keySet()){
it = ItemTemplateFactory.getInstance().getTemplateOrNull(id);
if(it == null){
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;
}
double oldValue = ReflectionUtil.getPrivateField(cw, ReflectionUtil.getField(cw.getClass(), "skillPenalty"));
double newValue = ArmouryMod.weaponSkillPenalty.get(id);
double newValue = ArmouryModMain.weaponSkillPenalty.get(id);
String diff;
if(newValue > oldValue){
diff = "+"+(newValue-oldValue);
@@ -368,7 +368,7 @@ public class WeaponTweaks {
final Class<WeaponTweaks> thisClass = WeaponTweaks.class;
String replace;
if(ArmouryMod.enableWeaponMaterialChanges){
if(ArmouryModMain.enableWeaponMaterialChanges){
Util.setReason("Enable weapon material damage modifications.");
CtClass ctWeapon = classPool.get("com.wurmonline.server.combat.Weapon");
replace = "{"