Skip to content

Instantly share code, notes, and snippets.

@bdew
bdew / ItemList.java
Created April 29, 2023 19:59
Wurm Item List
package com.wurmonline.server.items;
public final class ItemList
{
public static final int inventory = 0;
public static final int backPack = 1;
public static final int satchel = 2;
public static final int axeSmall = 3;
public static final int shieldMedium = 4;
public static final int potion = 5;
client/com/wurmonline/client/WurmEventHandler.java
client/com/wurmonline/client/comm/ServerConnectionListenerClass.java
client/com/wurmonline/client/comm/SimpleServerConnectionClass.java
client/com/wurmonline/client/console/ActionClass.java
client/com/wurmonline/client/console/WurmConsole.java
client/com/wurmonline/client/game/PlayerObj.java
client/com/wurmonline/client/game/inventory/InventoryMetaItem.java
client/com/wurmonline/client/game/inventory/InventoryMetaWindow.java
client/com/wurmonline/client/game/inventory/InventoryMetaWindowControl.java
client/com/wurmonline/client/game/inventory/InventoryMetaWindowFake.java
2018-04-10 18:14:25] WARNING com.wurmonline.server.behaviours.UnfinishedItemBehaviour: Equinox weird:bound must be positive
java.lang.IllegalArgumentException: bound must be positive
at java.util.Random.nextInt(Random.java:388)
at com.wurmonline.server.epic.EpicServerStatus.getRandomItemTemplateUsed(EpicServerStatus.java:1522)
at com.wurmonline.server.epic.EpicServerStatus.createGenericRitualMission(EpicServerStatus.java:1978)
at com.wurmonline.server.epic.EpicServerStatus.createMSRitualMission(EpicServerStatus.java:2017)
at com.wurmonline.server.epic.EpicServerStatus.generateNewMissionForEpicEntity(EpicServerStatus.java:1839)
at com.wurmonline.server.tutorial.TriggerEffect.effect(TriggerEffect.java:1206)
at com.wurmonline.server.tutorial.TriggerRun.runEffect(TriggerRun.java:251)
at com.wurmonline.server.tutorial.TriggerRun.run(TriggerRun.java:163)
[02:44:37 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: ModLoader version master-c6293ae
[02:44:37 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Loading mods\bagofholding.properties
[02:44:37 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Classpath: [mods\bagofholding\bagofholding.jar]
[02:44:37 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Loading mods\betterdig.properties
[02:44:37 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Classpath: [mods\betterdig\betterdig.jar]
[02:44:37 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Loading mods\bindmod.properties
[02:44:37 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Classpath: [mods\bindmod\bindmod.jar]
[02:44:37 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Loading mods\bountymod.properties
[02:44:37 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Classpath: [mods\bountymod\bountymod.jar]
[02:44:37 PM] INFO org.gotti.wurmunlimited.modloader.M
@bdew
bdew / gist:ddd9e2e7831a1865632429a91f98a1be
Created September 7, 2016 12:11
Generating enums for fun and profit
import javassist.*;
import javassist.bytecode.*;
import java.io.IOException;
public class ForageInjector {
private final CtClass forageCls;
private final ConstPool constPool;
private final ClassPool classPool;
private final CodeIterator codeIterator;
trait A {
def foo(x: String): String
}
trait B extends A {
final abstract override def foo(x: String) = super.foo(x) + " [Changed By B]"
}
class X extends A {
override def foo(x: String): String = x + " [Changed by X]"
@bdew
bdew / gist:61c82c4a5ef37714d17c
Last active March 25, 2017 19:14
Implicits in scala
/******************
* Implicit values *
*******************/
// Implicit values are defined with the keyword "implicit" and will be used automatically to fill
// in parameters defined with the same keyword elsewhere
// For example, here's a simple trait
trait Decorator {
---- Minecraft Crash Report ----
// Why is it breaking :(
Time: 6/12/15 12:30 PM
Description: Ticking block entity
java.lang.ClassCastException: stevesaddons.tileentities.TileEntityAENode cannot be cast to net.minecraft.inventory.IInventory
at vswe.stevesfactory.components.SlotInventoryHolder.getInventory(SlotInventoryHolder.java:29)
at vswe.stevesfactory.components.CraftingBufferFluidElement.disposeOfExtraItem(CraftingBufferFluidElement.java:97)
at vswe.stevesfactory.components.CraftingBufferFluidElement.releaseSubElements(CraftingBufferFluidElement.java:76)
@bdew
bdew / example.scala
Last active August 29, 2015 14:21
NBT Magic
// Instead of this mess ...
val oldTag = new NBTTagCompound
oldTag.setInteger("int", 1)
oldTag.setDouble("double", 2D)
oldTag.setString("string", "foo")
oldTag.setIntArray("intarray", Array(1, 2, 3))
oldTag.setByteArray("bytearray", Array[Byte](10, 20, 30))
oldTag.setBoolean("boolean", true)
@bdew
bdew / gist:94fcbea487bf49b7900d
Created May 25, 2015 11:08
Carbon value registration
NBTTagCompound tag = new NBTTagCompound();
ItemStack item = new ItemStack(Items.diamond);
// This is the item that will be registered
tag.setTag("item", item.writeToNBT(new NBTTagCompound()));
// Carbon value
tag.setInteger("value", 10000);
// Send message