Skip to content

Instantly share code, notes, and snippets.

View build.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()
View build.gradle.kts
apply plugin: 'java'
group = "com.joedobo27"
version = "1.0.0"
sourceCompatibility = JavaVersion.VERSION_1_8
def WUServerPath = "C:\\Users\\Jason\\Documents\\WU\\WU-Server\\"
repositories {
mavenCentral()
}
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()
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\\"
@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 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 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 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;
You can’t perform that action at this time.