Skip to content

Instantly share code, notes, and snippets.

@SpaceManiac
Created August 15, 2012 01:12
Show Gist options
  • Save SpaceManiac/3354480 to your computer and use it in GitHub Desktop.
Save SpaceManiac/3354480 to your computer and use it in GitHub Desktop.
Java Serialization Stuff for TkTech
package me.drayshak.WorldInventories;
import java.io.Serializable;
/* Trimmed to relevant parts only */
public class WIItemStack implements Serializable {
private static final long serialVersionUID = -6239771143618730223L;
private int type = 0;
private int amount = 0;
private WIMaterialData data = null;
private short durability = 0;
private Map<Integer, Integer> enchantments = new HashMap<Integer, Integer>();
}
package me.drayshak.WorldInventories;
import java.io.Serializable;
/* Trimmed to relevant parts only */
public class WIMaterialData implements Serializable {
private static final long serialVersionUID = 1385103110780786554L;
private final int type = 0;
private byte data = 0;
}
package me.drayshak.WorldInventories;
import java.io.Serializable;
/* Trimmed to relevant parts only */
public class WIPlayerInventory implements Serializable {
private static final long serialVersionUID = 6713780477882018072L;
WIItemStack[] playerItems = null;
WIItemStack[] playerArmour = null;
}
// Example serialized WIPlayerInventory:
// http://wombat.platymuus.com/dl/WIPlayerInventory.dat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment