Search in sources :

Example 11 with DimensionId

use of com.irtimaled.bbor.common.models.DimensionId in project BoundingBoxOutlineReloaded by irtimaled.

the class CommonInterop method chunkLoaded.

public static void chunkLoaded(Chunk chunk) {
    DimensionId dimensionId = DimensionId.from(chunk.getWorld().getDimension().getType());
    Map<String, StructureStart> structures = chunk.getStructureStarts();
    if (structures.size() > 0)
        EventBus.publish(new StructuresLoaded(structures, dimensionId));
}
Also used : StructureStart(net.minecraft.world.gen.feature.structure.StructureStart) DimensionId(com.irtimaled.bbor.common.models.DimensionId)

Example 12 with DimensionId

use of com.irtimaled.bbor.common.models.DimensionId in project BoundingBoxOutlineReloaded by irtimaled.

the class AddBoundingBox method getEvent.

public static AddBoundingBoxReceived getEvent(PayloadReader reader, String name) {
    DimensionId dimensionId = getDimensionId(reader, name);
    AbstractBoundingBox key = BoundingBoxDeserializer.deserialize(reader);
    if (key == null)
        return null;
    Set<AbstractBoundingBox> boundingBoxes = new HashSet<>();
    while (reader.isReadable()) {
        AbstractBoundingBox boundingBox = BoundingBoxDeserializer.deserialize(reader);
        boundingBoxes.add(boundingBox);
    }
    if (boundingBoxes.size() == 0)
        boundingBoxes.add(key);
    return new AddBoundingBoxReceived(dimensionId, key, boundingBoxes);
}
Also used : AddBoundingBoxReceived(com.irtimaled.bbor.client.events.AddBoundingBoxReceived) DimensionId(com.irtimaled.bbor.common.models.DimensionId) AbstractBoundingBox(com.irtimaled.bbor.common.models.AbstractBoundingBox) HashSet(java.util.HashSet)

Example 13 with DimensionId

use of com.irtimaled.bbor.common.models.DimensionId in project BoundingBoxOutlineReloaded by irtimaled.

the class CustomBeaconProvider method add.

public static void add(Coords coords, int level) {
    DimensionId dimensionId = Player.getDimensionId();
    BoundingBoxBeacon beacon = BoundingBoxBeacon.from(coords, level, BoundingBoxType.Custom);
    getCache(dimensionId).put(coords, beacon);
}
Also used : BoundingBoxBeacon(com.irtimaled.bbor.client.models.BoundingBoxBeacon) DimensionId(com.irtimaled.bbor.common.models.DimensionId)

Aggregations

DimensionId (com.irtimaled.bbor.common.models.DimensionId)13 Point (com.irtimaled.bbor.client.models.Point)4 AbstractBoundingBox (com.irtimaled.bbor.common.models.AbstractBoundingBox)2 HashSet (java.util.HashSet)2 AddBoundingBoxReceived (com.irtimaled.bbor.client.events.AddBoundingBoxReceived)1 BoundingBoxBeacon (com.irtimaled.bbor.client.models.BoundingBoxBeacon)1 BoundingBoxLine (com.irtimaled.bbor.client.models.BoundingBoxLine)1 BoundingBoxSphere (com.irtimaled.bbor.client.models.BoundingBoxSphere)1 PayloadBuilder (com.irtimaled.bbor.common.messages.PayloadBuilder)1 BoundingBoxCuboid (com.irtimaled.bbor.common.models.BoundingBoxCuboid)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Set (java.util.Set)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Minecraft (net.minecraft.client.Minecraft)1 StructureStart (net.minecraft.world.gen.feature.structure.StructureStart)1 SaveFormat (net.minecraft.world.storage.SaveFormat)1