Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. package au.id.rleach.testdata;
  2.  
  3. import org.spongepowered.api.data.DataContainer;
  4. import org.spongepowered.api.data.DataQuery;
  5. import org.spongepowered.api.data.DataSerializable;
  6. import org.spongepowered.api.data.MemoryDataContainer;
  7. import org.spongepowered.api.data.Queries;
  8. import org.spongepowered.api.world.Location;
  9. import org.spongepowered.api.world.World;
  10.  
  11. public class Home implements DataSerializable {
  12.  
  13. static final DataQuery LOCATION = DataQuery.of("location");
  14. Location<World> location;
  15.  
  16. public Home(Location<World> out) {
  17. this.location = out;
  18. }
  19.  
  20. @Override public int getContentVersion() {
  21. return 1;
  22. }
  23.  
  24. @Override public DataContainer toContainer() {
  25. final DataContainer container = new MemoryDataContainer();
  26. container.set(Queries.CONTENT_VERSION, getContentVersion());
  27. container.set(LOCATION, location.toContainer());
  28. return container;
  29. }
  30.  
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement