public abstract class NamedVersion extends Object
Modifier and Type | Field and Description |
---|---|
protected it.unimi.dsi.fastutil.ints.Int2ObjectMap<EntityType> |
entityTypes |
protected it.unimi.dsi.fastutil.ints.Int2ObjectMap<PacketType.Handshake> |
handshake |
protected it.unimi.dsi.fastutil.ints.Int2ObjectMap<PacketType.Login> |
login |
protected it.unimi.dsi.fastutil.ints.Int2ObjectMap<String> |
materialNameEntities |
protected it.unimi.dsi.fastutil.ints.Int2ObjectMap<Material> |
materials |
protected String |
name |
protected it.unimi.dsi.fastutil.ints.Int2ObjectMap<PacketType.Client> |
playIn |
protected it.unimi.dsi.fastutil.ints.Int2ObjectMap<PacketType.Server> |
playOut |
protected it.unimi.dsi.fastutil.ints.Int2ObjectMap<PacketType.Status> |
status |
Constructor and Description |
---|
NamedVersion(String name) |
Modifier and Type | Method and Description |
---|---|
@NonNull EntityType |
getEntityType(int id)
Get entity type according to given ID.
|
Material |
getMaterial(int id)
Get material according to block ID.
|
Material |
getMaterialForEntityBlock(int id) |
String |
getName() |
NPacket |
getPacket(PacketDirection dir,
int packetId)
Create packet with given ID for the given direction.
|
int |
getPacketId(PacketType type)
Get packet ID from given packet type
|
PacketType |
getPacketType(PacketDirection dir,
int packetId)
Create packet with given ID for the given direction.
|
protected void |
loadBlocks(String rawJson) |
void |
loadPostFlattening(String dir) |
void |
log() |
protected final it.unimi.dsi.fastutil.ints.Int2ObjectMap<PacketType.Client> playIn
protected final it.unimi.dsi.fastutil.ints.Int2ObjectMap<PacketType.Server> playOut
protected final it.unimi.dsi.fastutil.ints.Int2ObjectMap<PacketType.Handshake> handshake
protected final it.unimi.dsi.fastutil.ints.Int2ObjectMap<PacketType.Login> login
protected final it.unimi.dsi.fastutil.ints.Int2ObjectMap<PacketType.Status> status
protected final it.unimi.dsi.fastutil.ints.Int2ObjectMap<EntityType> entityTypes
protected final it.unimi.dsi.fastutil.ints.Int2ObjectMap<Material> materials
protected final it.unimi.dsi.fastutil.ints.Int2ObjectMap<String> materialNameEntities
protected final String name
public NamedVersion(String name)
public String getName()
public void log()
public void loadPostFlattening(String dir)
protected void loadBlocks(String rawJson) throws ParseException
ParseException
public NPacket getPacket(PacketDirection dir, int packetId)
Return unset packet if not found
dir
- direction of packet (for example: server to client)packetId
- the ID of the packetpublic PacketType getPacketType(PacketDirection dir, int packetId)
Return unset packet if not found
dir
- direction of packet (for example: server to client)packetId
- the ID of the packetpublic int getPacketId(PacketType type)
type
- the given typepublic @NonNull EntityType getEntityType(int id)
EntityType.UNKNOWN
is not foundid
- the entity type idpublic Material getMaterial(int id)
id
- the ID of the materialpublic Material getMaterialForEntityBlock(int id)