use of mcjty.rftools.items.dimlets.DimletMapping in project RFTools by McJty.
the class RfToolsDimensionManager method checkDimletConfigFromServer.
/**
* Here the information from the server arrives. This code is executed on the client.
*/
public void checkDimletConfigFromServer(Map<Integer, DimletKey> dimlets, World world) {
Logging.log("Getting dimlet mapping from server");
DimletMapping mapping = DimletMapping.getDimletMapping(world);
mapping.overrideServerMapping(dimlets);
KnownDimletConfiguration.init(world, false);
KnownDimletConfiguration.initCrafting(world);
}
use of mcjty.rftools.items.dimlets.DimletMapping in project RFTools by McJty.
the class RfToolsDimensionManager method checkDimletConfig.
/**
* Check if the client dimlet id's match with the server.
* This is executed on the server to the clients.
*/
public void checkDimletConfig(EntityPlayer player) {
if (!player.getEntityWorld().isRemote) {
// Send over dimlet configuration to the client so that the client can check that the id's match.
Logging.log("Send validation data to the client");
DimletMapping mapping = DimletMapping.getDimletMapping(player.getEntityWorld());
Map<Integer, DimletKey> dimlets = new HashMap<Integer, DimletKey>();
for (Integer id : mapping.getIds()) {
dimlets.put(id, mapping.getKey(id));
}
RFToolsMessages.INSTANCE.sendTo(new PacketCheckDimletConfig(dimlets), (EntityPlayerMP) player);
}
}
Aggregations