use of blusunrize.immersiveengineering.common.util.network.MessageMineralListSync in project ImmersiveEngineering by BluSunrize.
the class EventHandler method onLogin.
@SubscribeEvent(priority = EventPriority.HIGH)
public void onLogin(PlayerLoggedInEvent event) {
ExcavatorHandler.allowPackets = true;
if (!event.player.worldObj.isRemote) {
HashMap<MineralMix, Integer> packetMap = new HashMap<MineralMix, Integer>();
for (Entry<MineralMix, Integer> e : ExcavatorHandler.mineralList.entrySet()) if (e.getKey() != null && e.getValue() != null)
packetMap.put(e.getKey(), e.getValue());
ImmersiveEngineering.packetHandler.sendToAll(new MessageMineralListSync(packetMap));
}
}
use of blusunrize.immersiveengineering.common.util.network.MessageMineralListSync in project ImmersiveEngineering by BluSunrize.
the class ExcavatorHandler method recalculateChances.
public static void recalculateChances(boolean mutePackets) {
for (Map.Entry<MineralMix, Integer> e : mineralList.entrySet()) e.getKey().recalculateChances();
dimensionBasedTotalWeight.clear();
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER && allowPackets && !mutePackets) {
HashMap<MineralMix, Integer> packetMap = new HashMap<MineralMix, Integer>();
for (Map.Entry<MineralMix, Integer> e : ExcavatorHandler.mineralList.entrySet()) if (e.getKey() != null && e.getValue() != null)
packetMap.put(e.getKey(), e.getValue());
ImmersiveEngineering.packetHandler.sendToAll(new MessageMineralListSync(packetMap));
}
}
Aggregations