Add a job to find enchanted golden apples
This commit is contained in:
+5
-3
@@ -133,7 +133,7 @@ class Slot(Type):
|
||||
Boolean.send(value.present, socket)
|
||||
VarInt.send(value.item_id, socket)
|
||||
Byte.send(value.item_count, socket)
|
||||
TrailingByteArray.send(value.nbt, socket)
|
||||
Byte.send(0x00, socket)
|
||||
|
||||
|
||||
class Entry(Type):
|
||||
@@ -157,16 +157,18 @@ class Entry(Type):
|
||||
def __str__(self):
|
||||
return str(self.__dict__)
|
||||
def __repr__(self):
|
||||
return 'Entry(index={}, type={}, value={}'.format(
|
||||
return 'Entry(index={}, type={}, value={})'.format(
|
||||
self.index, self.type, self.value)
|
||||
|
||||
@staticmethod
|
||||
def read(file_object):
|
||||
def read(file_object, context):
|
||||
index = UnsignedByte.read(file_object)
|
||||
if index == 0xff: return None
|
||||
type = VarInt.read(file_object)
|
||||
try:
|
||||
value = Entry.types[type].read(file_object)
|
||||
except TypeError:
|
||||
value = Entry.types[type].read_with_context(file_object, context)
|
||||
except KeyError:
|
||||
return None
|
||||
return Entry(index, type, value)
|
||||
|
||||
Reference in New Issue
Block a user