use of com.builtbroken.mc.api.map.radio.IRadioWaveReceiver in project Engine by VoltzEngine-Project.
the class RadioMap method updateChunkCache.
protected void updateChunkCache(IRadioWaveReceiver receiver, Cube range) {
List<ChunkCoordIntPair> list = range.getChunkCoords();
//Update chunk position map
for (ChunkCoordIntPair pair : list) {
List<IRadioWaveReceiver> receivers = chunk_to_entities.get(pair);
if (receivers == null) {
receivers = new ArrayList();
}
if (!receivers.contains(receiver)) {
receivers.add(receiver);
}
chunk_to_entities.put(pair, receivers);
}
//Update receiver map
receive_to_chunks.put(receiver, list);
}
use of com.builtbroken.mc.api.map.radio.IRadioWaveReceiver in project Engine by VoltzEngine-Project.
the class RadioMap method updateSenderCache.
protected void updateSenderCache(IRadioWaveReceiver receiver, Cube range) {
if (range != null) {
//Update sender cache
for (IRadioWaveSender sender : sender_to_receivers_cache.keySet()) {
Cube senderRange = sender.getRadioSenderRange();
if (senderRange.doesOverlap(range)) {
List<IRadioWaveReceiver> receivers = sender_to_receivers_cache.get(sender);
if (receivers == null) {
receivers = new ArrayList();
}
if (!receivers.contains(receiver)) {
receivers.add(receiver);
}
sender_to_receivers_cache.put(sender, receivers);
}
}
}
}
Aggregations