Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. /*
  2. * Copyright (C) 2014 www.StarNub.org - Underbalanced
  3. *
  4. * This file is part of org.starnub a Java Wrapper for Starbound.
  5. *
  6. * This above mentioned StarNub software is free software:
  7. * you can redistribute it and/or modify it under the terms
  8. * of the GNU General Public License as published by the Free
  9. * Software Foundation, either version 3 of the License, or
  10. * any later version. This above mentioned CodeHome software
  11. * is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  14. * the GNU General Public License for more details. You should
  15. * have received a copy of the GNU General Public License in
  16. * this StarNub Software. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18.  
  19. package starbounddata.types.entity;
  20.  
  21. import io.netty.buffer.ByteBuf;
  22. import starbounddata.types.variants.VLQ;
  23.  
  24. /**
  25. * Starbound 1.0 Compliant (Versions 622, Update 1)
  26. */
  27. public class EntityId {
  28.  
  29. private long entityId;
  30.  
  31. public EntityId() {
  32. }
  33.  
  34. public EntityId(long entityId) {
  35. this.entityId = entityId;
  36. }
  37.  
  38. public EntityId(ByteBuf in) {
  39. readEntityId(in);
  40. }
  41.  
  42. public EntityId(EntityId entityId) {
  43. }
  44.  
  45. public void readEntityId(ByteBuf in) {
  46. this.entityId = VLQ.readSignedFromBufferNoObject(in);
  47. }
  48.  
  49. public long getEntityId() {
  50. return entityId;
  51. }
  52.  
  53. public void setEntityId(long entityId) {
  54. this.entityId = entityId;
  55. }
  56.  
  57. public void writeEntityId(ByteBuf out){
  58. out.writeBytes(VLQ.writeSignedVLQNoObject(entityId));
  59. }
  60.  
  61. public EntityId copy (){
  62. return new EntityId(this);
  63. }
  64.  
  65. @Override
  66. public String toString() {
  67. return "EntityId{" +
  68. "entityId=" + entityId +
  69. '}';
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement