Fixes for 1.9

This commit is contained in:
Sindusk
2019-04-14 00:24:25 -04:00
parent 550ef20925
commit a5f9c0c48b
5 changed files with 44 additions and 13 deletions

View File

@@ -920,6 +920,17 @@ public class MiscChanges {
Util.setReason("Hide buff bar icons for sorceries.");
Util.instrumentDescribed(thisClass, ctCommunicator, "sendAddStatusEffect", desc16, "isSendToBuffBar", replace);
// 1.9 Achievement fix [Bdew]
classPool.getCtClass("com.wurmonline.server.players.Achievements").getMethod("loadAllAchievements", "()V")
.instrument(new ExprEditor(){
@Override
public void edit(MethodCall m) throws CannotCompileException {
if (m.getMethodName().equals("getTimestamp"))
m.replace("$_=com.wurmonline.server.utils.DbUtilities.getTimestampOrNull(rs.getString($1)); " +
"if ($_==null) $_=new java.sql.Timestamp(java.lang.System.currentTimeMillis());");
}
});
} catch (CannotCompileException | NotFoundException | IllegalArgumentException | ClassCastException e) {
throw new HookException(e);
}