Search in sources :

Example 1 with ILandAspect

use of com.mraof.minestuck.world.lands.ILandAspect in project Minestuck by mraof.

the class LandAspectLootCondition method testCondition.

@Override
public boolean testCondition(Random rand, LootContext context) {
    WorldServer world = context.getWorld();
    if (world != null && MinestuckDimensionHandler.isLandDimension(world.provider.getDimension())) {
        AspectCombination aspects = MinestuckDimensionHandler.getAspects(world.provider.getDimension());
        TerrainLandAspect terrain = includeSubtypes ? aspects.aspectTerrain.getPrimaryVariant() : aspects.aspectTerrain;
        TitleLandAspect title = includeSubtypes ? aspects.aspectTitle.getPrimaryVariant() : aspects.aspectTitle;
        for (ILandAspect aspect : landAspectNames) if (terrain == aspect || title == aspect)
            return !inverted;
    }
    return inverted;
}
Also used : TerrainLandAspect(com.mraof.minestuck.world.lands.terrain.TerrainLandAspect) WorldServer(net.minecraft.world.WorldServer) TitleLandAspect(com.mraof.minestuck.world.lands.title.TitleLandAspect) ILandAspect(com.mraof.minestuck.world.lands.ILandAspect) AspectCombination(com.mraof.minestuck.world.lands.LandAspectRegistry.AspectCombination)

Aggregations

ILandAspect (com.mraof.minestuck.world.lands.ILandAspect)1 AspectCombination (com.mraof.minestuck.world.lands.LandAspectRegistry.AspectCombination)1 TerrainLandAspect (com.mraof.minestuck.world.lands.terrain.TerrainLandAspect)1 TitleLandAspect (com.mraof.minestuck.world.lands.title.TitleLandAspect)1 WorldServer (net.minecraft.world.WorldServer)1