Skip to content

Instantly share code, notes, and snippets.

Joedobo27

Block or report user

Report or block Joedobo27

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View build.gradle.kts
// **********************************************************
val wuServerPath = "C:\\Users\\Jason\\Documents\\WU\\WU-Server\\"
// **********************************************************
plugins {
application
java
}
View Title.java
package com.joedobo27.libs.creature;
import com.wurmonline.server.MiscConstants;
import java.util.ArrayList;
import java.util.Objects;
public class Title implements MiscConstants
{
View server_reference.gradle
apply plugin: 'java'
sourceCompatibility = 1.8
def WurmServerPath ="C:\\Users\\Jason\\Documents\\WU\\WU-Server\\"
def WurmServerDecompiledPath = "C:\\Users\\Jason\\IdeaProjects\\WurmServerDecompiled\\"
def procyon = "C:\\Users\\Jason\\Documents\\Java\\procyon-decompiler-0.5.30.jar"
repositories {
mavenCentral()
@Joedobo27
Joedobo27 / byteArrayToLineNumber.java
Created Jul 2, 2018
Find table-line-number from an array of bytes.
View byteArrayToLineNumber.java
private static int byteArrayToLineNumber(byte[] bytesSeek, CtMethod ctMethod, int byteArraySize)
throws BadBytecode, RuntimeException {
// Using bytesSeek iterate through the ctMethod's bytecode looking for a matching byte array sized to byteArraySize
int bytecodeIndex = -1;
CodeIterator codeIterator = ctMethod.getMethodInfo().getCodeAttribute().iterator();
codeIterator.begin();
long find = byteArrayToLong(bytesSeek);
while (codeIterator.hasNext() && codeIterator.lookAhead() + byteArraySize < codeIterator.getCodeLength()) {
int index = codeIterator.next();
@Joedobo27
Joedobo27 / ActionTime.java
Created May 26, 2018
TimeUnitTickedTriggerMod
View ActionTime.java
package com.joedobo27.tuttm;
import com.wurmonline.server.behaviours.Action;
import java.util.WeakHashMap;
@SuppressWarnings("unused")
public class ActionTime {
private int lastWholeUnitTime;
View example.gradle
apply plugin: 'java'
apply plugin: 'distribution'
group = 'com.joedobo27'
version = '1.0.3'
sourceCompatibility = 1.8
def WUServerPath = "C:\\Users\\Jason\\Documents\\WU\\WU-Server\\"
View MailCountLimitMod.java
package com.joedobo27.mcl;
import com.joedobo27.libs.bytecode.BytecodeTools;
import javassist.CannotCompileException;
import javassist.CtClass;
import javassist.CtPrimitiveType;
import javassist.NotFoundException;
import javassist.bytecode.*;
import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
import org.gotti.wurmunlimited.modloader.interfaces.Configurable;
View SkillGainInformationMod.java
package com.joedobo27.sgi;
import com.wurmonline.server.Players;
import com.wurmonline.server.players.Player;
import com.wurmonline.server.skills.Skill;
import javassist.*;
import javassist.bytecode.*;
import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
import org.gotti.wurmunlimited.modloader.interfaces.Initable;
import org.gotti.wurmunlimited.modloader.interfaces.WurmServerMod;
View BytecodeTools.java
package com.joedobo27.bulkoptions;
import javassist.bytecode.*;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Objects;
View action snip.java
// ACTION SET UP
if(counter == ACTION_START_TIME && hasAFailureCondition(performer, tileX, tileY, borderDirection))
return true;
if (counter == ACTION_START_TIME) {
youMessage = String.format("You start %s.", action.getActionString());
performer.getCommunicator().sendNormalServerMessage(youMessage);
broadcastMessage = String.format("%s starts to %s.", performer.getName(), action.getActionString());
Server.getInstance().broadCastAction(broadcastMessage, performer, 5);
int time = (int)ActionUtilities.getActionTime(10, 95, 200, 10,
You can’t perform that action at this time.