Search in sources :

Example 26 with Location

use of org.spongepowered.api.world.Location in project SpongeCommon by SpongePowered.

the class RandomBlockPopulator method populate.

@Override
public void populate(org.spongepowered.api.world.World world, Extent extent, Random random) {
    Vector3i min = extent.getBlockMin();
    Vector3i size = extent.getBlockSize();
    int n = this.count.getFlooredAmount(random);
    Location<World> chunkMin = new Location<World>(world, min.getX(), min.getY(), min.getZ());
    for (int i = 0; i < n; i++) {
        Location<World> pos = chunkMin.add(random.nextInt(size.getX()), this.height.getFlooredAmount(random), random.nextInt(size.getZ()));
        if (this.check.test(pos)) {
            world.setBlock(pos.getBlockPosition(), this.state);
            // Liquids force a block update tick so they may flow during world gen
            try {
                ((WorldServer) world).immediateBlockTick(((IMixinLocation) (Object) pos).getBlockPos(), (IBlockState) this.state, random);
            } catch (IllegalArgumentException e) {
            // ignore
            }
        }
    }
}
Also used : Vector3i(com.flowpowered.math.vector.Vector3i) WorldServer(net.minecraft.world.WorldServer) World(org.spongepowered.api.world.World) Location(org.spongepowered.api.world.Location) IMixinLocation(org.spongepowered.common.interfaces.world.IMixinLocation)

Example 27 with Location

use of org.spongepowered.api.world.Location in project SpongeCommon by SpongePowered.

the class RoofedForestPopulator method populate.

@Override
public void populate(org.spongepowered.api.world.World worldIn, Extent extent, Random random) {
    Vector3i min = extent.getBlockMin();
    BlockPos pos = new BlockPos(min.getX(), min.getY(), min.getZ());
    World world = (World) worldIn;
    List<PopulatorObject> results;
    PopulatorObject tree = BiomeTreeTypes.CANOPY.getPopulatorObject();
    for (int x = 0; x < 4; ++x) {
        for (int z = 0; z < 4; ++z) {
            int x0 = x * 4 + 1 + random.nextInt(3);
            int z0 = z * 4 + 1 + random.nextInt(3);
            BlockPos blockpos1 = world.getTopSolidOrLiquidBlock(pos.add(x0, 0, z0));
            if (this.override != null) {
                Location<Extent> pos2 = new Location<>(extent, VecHelper.toVector3i(blockpos1));
                tree = this.override.apply(pos2);
            } else {
                results = this.trees.get(random);
                if (results.isEmpty()) {
                    continue;
                }
                tree = results.get(0);
            }
            if (tree.canPlaceAt(worldIn, blockpos1.getX(), blockpos1.getY(), blockpos1.getZ())) {
                tree.placeObject(worldIn, random, blockpos1.getX(), blockpos1.getY(), blockpos1.getZ());
            }
        }
    }
}
Also used : PopulatorObject(org.spongepowered.api.world.gen.PopulatorObject) Extent(org.spongepowered.api.world.extent.Extent) Vector3i(com.flowpowered.math.vector.Vector3i) BlockPos(net.minecraft.util.math.BlockPos) World(net.minecraft.world.World) Location(org.spongepowered.api.world.Location)

Example 28 with Location

use of org.spongepowered.api.world.Location in project SpongeCommon by SpongePowered.

the class SpongeTeleportHelper method getBlockLocations.

private Stream<Vector3i> getBlockLocations(Location<World> worldLocation, int height, int width) {
    // We don't want to warp outside of the world border, so we want to check that we're within it.
    WorldBorder worldBorder = (WorldBorder) worldLocation.getExtent().getWorldBorder();
    int worldBorderMinX = GenericMath.floor(worldBorder.minX());
    int worldBorderMinZ = GenericMath.floor(worldBorder.minZ());
    int worldBorderMaxX = GenericMath.floor(worldBorder.maxX());
    int worldBorderMaxZ = GenericMath.floor(worldBorder.maxZ());
    // Get the World and get the maximum Y value.
    int worldMaxY = worldLocation.getExtent().getBlockMax().getY();
    Vector3i vectorLocation = worldLocation.getBlockPosition();
    // We use clamp to remain within the world confines, so we don't waste time checking blocks outside of the
    // world border and the world height.
    int minY = GenericMath.clamp(vectorLocation.getY() - height, 0, worldMaxY);
    int maxY = GenericMath.clamp(vectorLocation.getY() + height, 0, worldMaxY);
    int minX = GenericMath.clamp(vectorLocation.getX() - width, worldBorderMinX, worldBorderMaxX);
    int maxX = GenericMath.clamp(vectorLocation.getX() + width, worldBorderMinX, worldBorderMaxX);
    int minZ = GenericMath.clamp(vectorLocation.getZ() - width, worldBorderMinZ, worldBorderMaxZ);
    int maxZ = GenericMath.clamp(vectorLocation.getZ() + width, worldBorderMinZ, worldBorderMaxZ);
    // We now iterate over all possible x, y and z positions to get all possible vectors.
    List<Vector3i> vectors = new ArrayList<>();
    for (int y = minY; y <= maxY; y++) {
        for (int x = minX; x <= maxX; x++) {
            for (int z = minZ; z <= maxZ; z++) {
                vectors.add(new Vector3i(x, y, z));
            }
        }
    }
    Comparator<Vector3i> c = Comparator.comparingInt(vectorLocation::distanceSquared);
    // The compiler seems to need this to be a new line.
    // We check to see what the y location is, preferring changes in Y over X and Z, and higher over lower locations.
    c = c.thenComparing(x -> -Math.abs(vectorLocation.getY() - x.getY())).thenComparing(x -> -x.getY());
    // Sort them according to the distance to the provided worldLocation.
    return vectors.stream().sorted(c);
}
Also used : SpongeImpl(org.spongepowered.common.SpongeImpl) IMixinChunkProviderServer(org.spongepowered.common.interfaces.world.gen.IMixinChunkProviderServer) Location(org.spongepowered.api.world.Location) Collection(java.util.Collection) GenericMath(com.flowpowered.math.GenericMath) WorldBorder(net.minecraft.world.border.WorldBorder) Set(java.util.Set) HashMap(java.util.HashMap) Sets(com.google.common.collect.Sets) Tristate(org.spongepowered.api.util.Tristate) ArrayList(java.util.ArrayList) BlockState(org.spongepowered.api.block.BlockState) TeleportHelperFilter(org.spongepowered.api.world.teleport.TeleportHelperFilter) List(java.util.List) Stream(java.util.stream.Stream) TeleportHelperFilters(org.spongepowered.api.world.teleport.TeleportHelperFilters) Vector3i(com.flowpowered.math.vector.Vector3i) World(org.spongepowered.api.world.World) Map(java.util.Map) Optional(java.util.Optional) Comparator(java.util.Comparator) TeleportHelper(org.spongepowered.api.world.TeleportHelper) Singleton(com.google.inject.Singleton) WorldBorder(net.minecraft.world.border.WorldBorder) Vector3i(com.flowpowered.math.vector.Vector3i) ArrayList(java.util.ArrayList)

Example 29 with Location

use of org.spongepowered.api.world.Location in project SpongeCommon by SpongePowered.

the class DataRegistrar method setupSerialization.

@SuppressWarnings("unchecked")
public static void setupSerialization() {
    SpongeDataManager dataManager = SpongeDataManager.getInstance();
    // TileEntities
    dataManager.registerBuilder(Banner.class, new SpongeBannerBuilder());
    dataManager.registerBuilder(PatternLayer.class, new SpongePatternLayerBuilder());
    dataManager.registerBuilder(BrewingStand.class, new SpongeBrewingStandBuilder());
    dataManager.registerBuilder(Chest.class, new SpongeChestBuilder());
    dataManager.registerBuilder(CommandBlock.class, new SpongeCommandBlockBuilder());
    dataManager.registerBuilder(Comparator.class, new SpongeComparatorBuilder());
    dataManager.registerBuilder(DaylightDetector.class, new SpongeDaylightBuilder());
    dataManager.registerBuilder(Dispenser.class, new SpongeDispenserBuilder());
    dataManager.registerBuilder(Dropper.class, new SpongeDropperBuilder());
    dataManager.registerBuilder(EnchantmentTable.class, new SpongeEnchantmentTableBuilder());
    dataManager.registerBuilder(EnderChest.class, new SpongeEnderChestBuilder());
    dataManager.registerBuilder(EndPortal.class, new SpongeEndPortalBuilder());
    dataManager.registerBuilder(Furnace.class, new SpongeFurnaceBuilder());
    dataManager.registerBuilder(Hopper.class, new SpongeHopperBuilder());
    dataManager.registerBuilder(MobSpawner.class, new SpongeMobSpawnerBuilder());
    dataManager.registerBuilder(Note.class, new SpongeNoteBuilder());
    dataManager.registerBuilder(Sign.class, new SpongeSignBuilder());
    dataManager.registerBuilder(Skull.class, new SpongeSkullBuilder());
    dataManager.registerBuilder(Beacon.class, new SpongeBeaconBuilder());
    dataManager.registerBuilder(LocatableBlock.class, new SpongeLocatableBlockBuilder());
    // Block stuff
    dataManager.registerBuilder(BlockSnapshot.class, new SpongeBlockSnapshotBuilder());
    dataManager.registerBuilder(BlockState.class, new SpongeBlockStateBuilder());
    dataManager.registerBuilderAndImpl(ImmutableTreeData.class, ImmutableSpongeTreeData.class, new ImmutableSpongeTreeDataBuilder());
    // Entity stuff
    dataManager.registerBuilder(EntitySnapshot.class, new SpongeEntitySnapshotBuilder());
    // ItemStack stuff
    dataManager.registerBuilder(ItemStack.class, new SpongeItemStackBuilder());
    dataManager.registerBuilder(ItemStackSnapshot.class, new SpongeItemStackSnapshotBuilder());
    dataManager.registerBuilder(Enchantment.class, new SpongeEnchantmentBuilder());
    dataManager.registerBuilderAndImpl(ImmutableEnchantmentData.class, ImmutableSpongeEnchantmentData.class, new ImmutableItemEnchantmentDataBuilder());
    dataManager.registerBuilder(FireworkEffect.class, new SpongeFireworkEffectDataBuilder());
    // Text stuff
    dataManager.registerBuilder(Text.class, new TextConfigSerializer());
    dataManager.registerBuilder(BookView.class, new BookViewDataBuilder());
    // Effects stuff
    dataManager.registerBuilder(ParticleEffect.class, new SpongeParticleEffectBuilder());
    // Util stuff
    dataManager.registerBuilder(VariableAmount.BaseAndAddition.class, new BaseAndAdditionBuilder());
    dataManager.registerBuilder(VariableAmount.BaseAndVariance.class, new BaseAndVarianceBuilder());
    dataManager.registerBuilder(VariableAmount.Fixed.class, new FixedBuilder());
    dataManager.registerBuilder(VariableAmount.OptionalAmount.class, new OptionalVarianceBuilder());
    dataManager.registerBuilder((Class<Location<World>>) (Class<?>) Location.class, new LocationBuilder());
    dataManager.registerBuilder(SpongePlayerData.class, new SpongePlayerData.Builder());
    dataManager.registerBuilder(GameProfile.class, new SpongeGameProfileBuilder());
    // Content Updaters
    dataManager.registerContentUpdater(BlockState.class, new SpongeBlockStateMetaContentUpdater());
    final InvisibilityDataAddVanishUpdater invisibilityUpdater = new InvisibilityDataAddVanishUpdater();
    dataManager.registerContentUpdater(InvisibilityData.class, invisibilityUpdater);
    dataManager.registerContentUpdater(ImmutableInvisibilityData.class, invisibilityUpdater);
    dataManager.registerContentUpdater(SpongeInvisibilityData.class, invisibilityUpdater);
    dataManager.registerContentUpdater(ImmutableSpongeInvisibilityData.class, invisibilityUpdater);
    final PotionEffectContentUpdater potionUpdater = new PotionEffectContentUpdater();
    dataManager.registerContentUpdater(PotionEffect.class, potionUpdater);
    dataManager.registerContentUpdater(PotionEffectData.class, potionUpdater);
    dataManager.registerContentUpdater(ImmutablePotionEffectData.class, potionUpdater);
    dataManager.registerContentUpdater(SpongePotionEffectData.class, potionUpdater);
    dataManager.registerContentUpdater(ImmutableSpongePotionEffectData.class, potionUpdater);
    // Content Updaters for Custom Data
    dataManager.registerContentUpdater(DataManipulator.class, new LegacyCustomDataClassContentUpdater());
    // Data Manipulators
    DataUtil.registerDataProcessorAndImpl(DisplayNameData.class, SpongeDisplayNameData.class, ImmutableDisplayNameData.class, ImmutableSpongeDisplayNameData.class, new DisplayNameDataProcessor());
    // Entity Processors
    DataUtil.registerDataProcessorAndImpl(ArmorStandData.class, SpongeArmorStandData.class, ImmutableArmorStandData.class, ImmutableSpongeArmorStandData.class, new ArmorStandDataProcessor());
    DataUtil.registerDataProcessorAndImpl(InvulnerabilityData.class, SpongeInvulnerabilityData.class, ImmutableInvulnerabilityData.class, ImmutableSpongeInvulnerabilityData.class, new InvulnerabilityDataProcessor());
    DataUtil.registerDataProcessorAndImpl(DamageableData.class, SpongeDamageableData.class, ImmutableDamageableData.class, ImmutableSpongeDamageableData.class, new DamageableDataProcessor());
    DataUtil.registerDataProcessorAndImpl(FuseData.class, SpongeFuseData.class, ImmutableFuseData.class, ImmutableSpongeFuseData.class, new FuseDataProcessor());
    DataUtil.registerDualProcessor(ExplosionRadiusData.class, SpongeExplosionRadiusData.class, ImmutableExplosionRadiusData.class, ImmutableSpongeExplosionRadiusData.class, new ExplosionRadiusDataProcessor());
    DataUtil.registerDualProcessor(FireworkEffectData.class, SpongeFireworkEffectData.class, ImmutableFireworkEffectData.class, ImmutableSpongeFireworkEffectData.class, new FireworkEffectDataProcessor());
    DataUtil.registerDualProcessor(FireworkRocketData.class, SpongeFireworkRocketData.class, ImmutableFireworkRocketData.class, ImmutableSpongeFireworkRocketData.class, new FireworkRocketDataProcessor());
    DataUtil.registerDataProcessorAndImpl(HealthData.class, SpongeHealthData.class, ImmutableHealthData.class, ImmutableSpongeHealthData.class, new HealthDataProcessor());
    DataUtil.registerDataProcessorAndImpl(AgeableData.class, SpongeAgeableData.class, ImmutableAgeableData.class, ImmutableSpongeAgeableData.class, new AgeableDataProcessor());
    DataUtil.registerDataProcessorAndImpl(AgeableData.class, SpongeAgeableData.class, ImmutableAgeableData.class, ImmutableSpongeAgeableData.class, new ZombieAgeableDataProcessor());
    DataUtil.registerDataProcessorAndImpl(IgniteableData.class, SpongeIgniteableData.class, ImmutableIgniteableData.class, ImmutableSpongeIgniteableData.class, new IgniteableDataProcessor());
    DataUtil.registerDualProcessor(VelocityData.class, SpongeVelocityData.class, ImmutableVelocityData.class, ImmutableSpongeVelocityData.class, new VelocityDataProcessor());
    DataUtil.registerDataProcessorAndImpl(FoodData.class, SpongeFoodData.class, ImmutableFoodData.class, ImmutableSpongeFoodData.class, new FoodDataProcessor());
    DataUtil.registerDataProcessorAndImpl(BreathingData.class, SpongeBreathingData.class, ImmutableBreathingData.class, ImmutableSpongeBreathingData.class, new BreathingDataProcessor());
    DataUtil.registerDualProcessor(ScreamingData.class, SpongeScreamingData.class, ImmutableScreamingData.class, ImmutableSpongeScreamingData.class, new ScreamingDataProcessor());
    DataUtil.registerDualProcessor(SilentData.class, SpongeSilentData.class, ImmutableSilentData.class, ImmutableSpongeSilentData.class, new SilentDataProcessor());
    DataUtil.registerDualProcessor(RepresentedItemData.class, SpongeRepresentedItemData.class, ImmutableRepresentedItemData.class, ImmutableSpongeRepresentedItemData.class, new RepresentedItemDataProcessor());
    DataUtil.registerDataProcessorAndImpl(HorseData.class, SpongeHorseData.class, ImmutableHorseData.class, ImmutableSpongeHorseData.class, new HorseDataProcessor());
    DataUtil.registerDualProcessor(SneakingData.class, SpongeSneakingData.class, ImmutableSneakingData.class, ImmutableSpongeSneakingData.class, new SneakingDataProcessor());
    DataUtil.registerDataProcessorAndImpl(ExperienceHolderData.class, SpongeExperienceHolderData.class, ImmutableExperienceHolderData.class, ImmutableSpongeExperienceHolderData.class, new ExperienceHolderDataProcessor());
    DataUtil.registerDataProcessorAndImpl(MovementSpeedData.class, SpongeMovementSpeedData.class, ImmutableMovementSpeedData.class, ImmutableSpongeMovementSpeedData.class, new MovementSpeedDataProcessor());
    DataUtil.registerDualProcessor(SlimeData.class, SpongeSlimeData.class, ImmutableSlimeData.class, ImmutableSpongeSlimeData.class, new SlimeDataProcessor());
    DataUtil.registerDualProcessor(PlayingData.class, SpongePlayingData.class, ImmutablePlayingData.class, ImmutableSpongePlayingData.class, new PlayingDataProcessor());
    DataUtil.registerDualProcessor(SittingData.class, SpongeSittingData.class, ImmutableSittingData.class, ImmutableSpongeSittingData.class, new SittingDataProcessor());
    DataUtil.registerDualProcessor(JohnnyData.class, SpongeJohnnyData.class, ImmutableJohnnyData.class, ImmutableSpongeJohnnyData.class, new JohnnyDataProcessor());
    DataUtil.registerDualProcessor(ShearedData.class, SpongeShearedData.class, ImmutableShearedData.class, ImmutableSpongeShearedData.class, new ShearedDataProcessor());
    DataUtil.registerDualProcessor(PigSaddleData.class, SpongePigSaddleData.class, ImmutablePigSaddleData.class, ImmutableSpongePigSaddleData.class, new PigSaddleDataProcessor());
    DataUtil.registerDualProcessor(TameableData.class, SpongeTameableData.class, ImmutableTameableData.class, ImmutableSpongeTameableData.class, new TameableDataProcessor());
    DataUtil.registerDualProcessor(TameableData.class, SpongeTameableData.class, ImmutableTameableData.class, ImmutableSpongeTameableData.class, new HorseTameableDataProcessor());
    DataUtil.registerDualProcessor(WetData.class, SpongeWetData.class, ImmutableWetData.class, ImmutableSpongeWetData.class, new WolfWetDataProcessor());
    DataUtil.registerDualProcessor(AgentData.class, SpongeAgentData.class, ImmutableAgentData.class, ImmutableSpongeAgentData.class, new AgentDataProcessor());
    DataUtil.registerDualProcessor(ChargedData.class, SpongeChargedData.class, ImmutableChargedData.class, ImmutableSpongeChargedData.class, new ChargedDataProcessor());
    DataUtil.registerDualProcessor(FallDistanceData.class, SpongeFallDistanceData.class, ImmutableFallDistanceData.class, ImmutableSpongeFallDistanceData.class, new FallDistanceDataProcessor());
    DataUtil.registerDataProcessorAndImpl(VehicleData.class, SpongeVehicleData.class, ImmutableVehicleData.class, ImmutableSpongeVehicleData.class, new VehicleDataProcessor());
    DataUtil.registerDualProcessor(TreeData.class, SpongeTreeData.class, ImmutableTreeData.class, ImmutableSpongeTreeData.class, new BoatTreeTypeValueProcessor());
    DataUtil.registerDualProcessor(PassengerData.class, SpongePassengerData.class, ImmutablePassengerData.class, ImmutableSpongePassengerData.class, new PassengerDataProcessor());
    DataUtil.registerDataProcessorAndImpl(MinecartBlockData.class, SpongeMinecartBlockData.class, ImmutableMinecartBlockData.class, ImmutableSpongeMinecartBlockData.class, new MinecartBlockDataProcessor());
    DataUtil.registerDualProcessor(PlayerCreatedData.class, SpongePlayerCreatedData.class, ImmutablePlayerCreatedData.class, ImmutableSpongePlayerCreatedData.class, new PlayerCreatedDataProcessor());
    DataUtil.registerDataProcessorAndImpl(InvisibilityData.class, SpongeInvisibilityData.class, ImmutableInvisibilityData.class, ImmutableSpongeInvisibilityData.class, new InvisibilityDataProcessor());
    DataUtil.registerDataProcessorAndImpl(FallingBlockData.class, SpongeFallingBlockData.class, ImmutableFallingBlockData.class, ImmutableSpongeFallingBlockData.class, new FallingBlockDataProcessor());
    DataUtil.registerDualProcessor(RabbitData.class, SpongeRabbitData.class, ImmutableRabbitData.class, ImmutableSpongeRabbitData.class, new RabbitDataProcessor());
    DataUtil.registerDualProcessor(RespawnLocationData.class, SpongeRespawnLocationData.class, ImmutableRespawnLocation.class, ImmutableSpongeRespawnLocation.class, new RespawnLocationDataProcessor());
    DataUtil.registerDataProcessorAndImpl(CommandData.class, SpongeCommandData.class, ImmutableCommandData.class, ImmutableSpongeCommandData.class, new EntityCommandDataProcessor());
    DataUtil.registerDualProcessor(ExpirableData.class, SpongeExpirableData.class, ImmutableExpirableData.class, ImmutableSpongeExpirableData.class, new EndermiteExpirableDataProcessor());
    DataUtil.registerDualProcessor(ArtData.class, SpongeArtData.class, ImmutableArtData.class, ImmutableSpongeArtData.class, new ArtDataProcessor());
    DataUtil.registerDualProcessor(CareerData.class, SpongeCareerData.class, ImmutableCareerData.class, ImmutableSpongeCareerData.class, new CareerDataProcessor());
    DataUtil.registerDualProcessor(SkinData.class, SpongeSkinData.class, ImmutableSkinData.class, ImmutableSpongeSkinData.class, new SkinDataProcessor());
    DataUtil.registerDualProcessor(ExpOrbData.class, SpongeExpOrbData.class, ImmutableExpOrbData.class, ImmutableSpongeExpOrbData.class, new ExpOrbDataProcessor());
    DataUtil.registerDualProcessor(FlyingData.class, SpongeFlyingData.class, ImmutableFlyingData.class, ImmutableSpongeFlyingData.class, new FlyingDataProcessor());
    DataUtil.registerDualProcessor(FlyingAbilityData.class, SpongeFlyingAbilityData.class, ImmutableFlyingAbilityData.class, ImmutableSpongeFlyingAbilityData.class, new FlyingAbilityDataProcessor());
    DataUtil.registerDualProcessor(OcelotData.class, SpongeOcelotData.class, ImmutableOcelotData.class, ImmutableSpongeOcelotData.class, new OcelotDataProcessor());
    DataUtil.registerDualProcessor(GameModeData.class, SpongeGameModeData.class, ImmutableGameModeData.class, ImmutableSpongeGameModeData.class, new GameModeDataProcessor());
    DataUtil.registerDualProcessor(AbsorptionData.class, SpongeAbsorptionData.class, ImmutableAbsorptionData.class, ImmutableSpongeAbsorptionData.class, new AbsorptionDataProcessor());
    DataUtil.registerDualProcessor(AggressiveData.class, SpongeAggressiveData.class, ImmutableAggressiveData.class, ImmutableSpongeAggressiveData.class, new AggressiveDataProcessor());
    DataUtil.registerDualProcessor(AngerableData.class, SpongeAngerableData.class, ImmutableAngerableData.class, ImmutableSpongeAngerableData.class, new AngerableDataProcessor());
    DataUtil.registerDualProcessor(RotationalData.class, SpongeRotationalData.class, ImmutableRotationalData.class, ImmutableSpongeRotationalData.class, new RotationalDataProcessor());
    DataUtil.registerDualProcessor(AffectsSpawningData.class, SpongeAffectsSpawningData.class, ImmutableAffectsSpawningData.class, ImmutableSpongeAffectsSpawningData.class, new AffectsSpawningDataProcessor());
    DataUtil.registerDualProcessor(CriticalHitData.class, SpongeCriticalHitData.class, ImmutableCriticalHitData.class, ImmutableSpongeCriticalHitData.class, new CriticalHitDataProcessor());
    DataUtil.registerDualProcessor(TradeOfferData.class, SpongeTradeOfferData.class, ImmutableTradeOfferData.class, ImmutableSpongeTradeOfferData.class, new TradeOfferDataProcessor());
    DataUtil.registerDualProcessor(KnockbackData.class, SpongeKnockbackData.class, ImmutableKnockbackData.class, ImmutableSpongeKnockbackData.class, new KnockbackDataProcessor());
    DataUtil.registerDualProcessor(FlammableData.class, SpongeFlammableData.class, ImmutableFlammableData.class, ImmutableSpongeFlammableData.class, new BlazeFlammableDataProcessor());
    DataUtil.registerDualProcessor(PersistingData.class, SpongePersistingData.class, ImmutablePersistingData.class, ImmutableSpongePersistingData.class, new PersistingDataProcessor());
    DataUtil.registerDualProcessor(SprintData.class, SpongeSprintData.class, ImmutableSprintData.class, ImmutableSpongeSprintData.class, new SprintDataProcessor());
    DataUtil.registerDualProcessor(StatisticData.class, SpongeStatisticData.class, ImmutableStatisticData.class, ImmutableSpongeStatisticData.class, new StatisticDataProcessor());
    DataUtil.registerDualProcessor(StuckArrowsData.class, SpongeStuckArrowsData.class, ImmutableStuckArrowsData.class, ImmutableSpongeStuckArrowsData.class, new StuckArrowsDataProcessor());
    DataUtil.registerDualProcessor(BreedableData.class, SpongeBreedableData.class, ImmutableBreedableData.class, ImmutableSpongeBreedableData.class, new BreedableDataProcessor());
    DataUtil.registerDataProcessorAndImpl(JoinData.class, SpongeJoinData.class, ImmutableJoinData.class, ImmutableSpongeJoinData.class, new JoinDataProcessor());
    DataUtil.registerDualProcessor(PotionEffectData.class, SpongePotionEffectData.class, ImmutablePotionEffectData.class, ImmutableSpongePotionEffectData.class, new EntityPotionDataProcessor());
    DataUtil.registerDualProcessor(PotionEffectData.class, SpongePotionEffectData.class, ImmutablePotionEffectData.class, ImmutableSpongePotionEffectData.class, new PotionEntityPotionDataProcessor());
    DataUtil.registerDualProcessor(PotionEffectData.class, SpongePotionEffectData.class, ImmutablePotionEffectData.class, ImmutableSpongePotionEffectData.class, new TippedArrowPotionDataProcessor());
    DataUtil.registerDataProcessorAndImpl(BodyPartRotationalData.class, SpongeBodyPartRotationalData.class, ImmutableBodyPartRotationalData.class, ImmutableSpongeBodyPartRotationalData.class, new ArmorStandBodyPartRotationalDataProcessor());
    DataUtil.registerDualProcessor(GriefingData.class, SpongeGriefingData.class, ImmutableGriefingData.class, ImmutableSpongeGriefingData.class, new GriefingDataProcessor());
    DataUtil.registerDualProcessor(TargetedLocationData.class, SpongeTargetedLocationData.class, ImmutableTargetedLocationData.class, ImmutableSpongeTargetedLocationData.class, new EntityTargetedLocationDataProcessor());
    DataUtil.registerDualProcessor(CustomNameVisibleData.class, SpongeCustomNameVisibleData.class, ImmutableCustomNameVisibleData.class, ImmutableSpongeCustomNameVisibleData.class, new CustomNameVisibleProcessor());
    DataUtil.registerDualProcessor(GlowingData.class, SpongeGlowingData.class, ImmutableGlowingData.class, ImmutableSpongeGlowingData.class, new GlowingDataProcessor());
    DataUtil.registerDualProcessor(GravityData.class, SpongeGravityData.class, ImmutableGravityData.class, ImmutableSpongeGravityData.class, new GravityDataProcessor());
    DataUtil.registerDualProcessor(PickupRuleData.class, SpongePickupRuleData.class, ImmutablePickupRuleData.class, ImmutableSpongePickupRuleData.class, new PickupRuleDataProcessor());
    DataUtil.registerDualProcessor(ParrotData.class, SpongeParrotData.class, ImmutableParrotData.class, ImmutableSpongeParrotData.class, new ParrotDataProcessor());
    DataUtil.registerDataProcessorAndImpl(PickupDelayData.class, SpongePickupDelayData.class, ImmutablePickupDelayData.class, ImmutableSpongePickupDelayData.class, new PickupDelayDataProcessor());
    DataUtil.registerDataProcessorAndImpl(DespawnDelayData.class, SpongeDespawnDelayData.class, ImmutableDespawnDelayData.class, ImmutableSpongeDespawnDelayData.class, new DespawnDelayDataProcessor());
    DataUtil.registerDataProcessorAndImpl(AreaEffectCloudData.class, SpongeAreaEffectData.class, ImmutableAreaEffectCloudData.class, ImmutableSpongeAreaEffectCloudData.class, new AreaEffectCloudDataProcessor());
    DataUtil.registerDualProcessor(DyeableData.class, SpongeDyeableData.class, ImmutableDyeableData.class, ImmutableSpongeDyeableData.class, new SheepDyeColorDataProcessor());
    DataUtil.registerDualProcessor(DyeableData.class, SpongeDyeableData.class, ImmutableDyeableData.class, ImmutableSpongeDyeableData.class, new WolfDyeColorDataProcessor());
    // Item Processors
    DataUtil.registerDualProcessor(FireworkEffectData.class, SpongeFireworkEffectData.class, ImmutableFireworkEffectData.class, ImmutableSpongeFireworkEffectData.class, new ItemFireworkEffectDataProcessor());
    DataUtil.registerDualProcessor(FireworkRocketData.class, SpongeFireworkRocketData.class, ImmutableFireworkRocketData.class, ImmutableSpongeFireworkRocketData.class, new ItemFireworkRocketDataProcessor());
    DataUtil.registerDualProcessor(SkullData.class, SpongeSkullData.class, ImmutableSkullData.class, ImmutableSpongeSkullData.class, new ItemSkullDataProcessor());
    DataUtil.registerDualProcessor(SignData.class, SpongeSignData.class, ImmutableSignData.class, ImmutableSpongeSignData.class, new ItemSignDataProcessor());
    DataUtil.registerDualProcessor(WetData.class, SpongeWetData.class, ImmutableWetData.class, ImmutableSpongeWetData.class, new ItemWetDataProcessor());
    DataUtil.registerDualProcessor(ColoredData.class, SpongeColoredData.class, ImmutableColoredData.class, ImmutableSpongeColoredData.class, new ColoredDataProcessor());
    DataUtil.registerDualProcessor(EnchantmentData.class, SpongeEnchantmentData.class, ImmutableEnchantmentData.class, ImmutableSpongeEnchantmentData.class, new ItemEnchantmentDataProcessor());
    DataUtil.registerDualProcessor(LoreData.class, SpongeLoreData.class, ImmutableLoreData.class, ImmutableSpongeLoreData.class, new ItemLoreDataProcessor());
    DataUtil.registerDualProcessor(PagedData.class, SpongePagedData.class, ImmutablePagedData.class, ImmutableSpongePagedData.class, new ItemPagedDataProcessor());
    DataUtil.registerDualProcessor(GoldenAppleData.class, SpongeGoldenAppleData.class, ImmutableGoldenAppleData.class, ImmutableSpongeGoldenAppleData.class, new GoldenAppleDataProcessor());
    DataUtil.registerDualProcessor(AuthorData.class, SpongeAuthorData.class, ImmutableAuthorData.class, ImmutableSpongeAuthorData.class, new ItemAuthorDataProcessor());
    DataUtil.registerDualProcessor(BreakableData.class, SpongeBreakableData.class, ImmutableBreakableData.class, ImmutableSpongeBreakableData.class, new BreakableDataProcessor());
    DataUtil.registerDualProcessor(PlaceableData.class, SpongePlaceableData.class, ImmutablePlaceableData.class, ImmutableSpongePlaceableData.class, new PlaceableDataProcessor());
    DataUtil.registerDualProcessor(CoalData.class, SpongeCoalData.class, ImmutableCoalData.class, ImmutableSpongeCoalData.class, new CoalDataProcessor());
    DataUtil.registerDualProcessor(CookedFishData.class, SpongeCookedFishData.class, ImmutableCookedFishData.class, ImmutableSpongeCookedFishData.class, new CookedFishDataProcessor());
    DataUtil.registerDualProcessor(FishData.class, SpongeFishData.class, ImmutableFishData.class, ImmutableSpongeFishData.class, new FishDataProcessor());
    DataUtil.registerDualProcessor(RepresentedPlayerData.class, SpongeRepresentedPlayerData.class, ImmutableRepresentedPlayerData.class, ImmutableSpongeRepresentedPlayerData.class, new ItemSkullRepresentedPlayerDataProcessor());
    DataUtil.registerDualProcessor(LockableData.class, SpongeLockableData.class, ImmutableLockableData.class, ImmutableSpongeLockableData.class, new ItemLockableDataProcessor());
    DataUtil.registerDataProcessorAndImpl(DurabilityData.class, SpongeDurabilityData.class, ImmutableDurabilityData.class, ImmutableSpongeDurabilityData.class, new DurabilityDataProcessor());
    DataUtil.registerDualProcessor(SpawnableData.class, SpongeSpawnableData.class, ImmutableSpawnableData.class, ImmutableSpongeSpawnableData.class, new SpawnableDataProcessor());
    DataUtil.registerDualProcessor(BlockItemData.class, SpongeBlockItemData.class, ImmutableBlockItemData.class, ImmutableSpongeBlockItemData.class, new BlockItemDataProcessor());
    DataUtil.registerDualProcessor(GenerationData.class, SpongeGenerationData.class, ImmutableGenerationData.class, ImmutableSpongeGenerationData.class, new GenerationDataProcessor());
    DataUtil.registerDualProcessor(StoredEnchantmentData.class, SpongeStoredEnchantmentData.class, ImmutableStoredEnchantmentData.class, ImmutableSpongeStoredEnchantmentData.class, new StoredEnchantmentDataProcessor());
    DataUtil.registerDualProcessor(FluidItemData.class, SpongeFluidItemData.class, ImmutableFluidItemData.class, ImmutableSpongeFluidItemData.class, new FluidItemDataProcessor());
    DataUtil.registerDualProcessor(PotionEffectData.class, SpongePotionEffectData.class, ImmutablePotionEffectData.class, ImmutableSpongePotionEffectData.class, new ItemPotionDataProcessor());
    DataUtil.registerDataProcessorAndImpl(HideData.class, SpongeHideData.class, ImmutableHideData.class, ImmutableSpongeHideData.class, new HideDataProcessor());
    DataUtil.registerDualProcessor(DyeableData.class, SpongeDyeableData.class, ImmutableDyeableData.class, ImmutableSpongeDyeableData.class, new ItemDyeColorDataProcessor());
    // Block Processors
    DataUtil.registerDualProcessor(DirtData.class, SpongeDirtData.class, ImmutableDirtData.class, ImmutableSpongeDirtData.class, new DirtDataProcessor());
    DataUtil.registerDualProcessor(StoneData.class, SpongeStoneData.class, ImmutableStoneData.class, ImmutableSpongeStoneData.class, new StoneDataProcessor());
    DataUtil.registerDualProcessor(PrismarineData.class, SpongePrismarineData.class, ImmutablePrismarineData.class, ImmutableSpongePrismarineData.class, new PrismarineDataProcessor());
    DataUtil.registerDualProcessor(BrickData.class, SpongeBrickData.class, ImmutableBrickData.class, ImmutableSpongeBrickData.class, new BrickDataProcessor());
    DataUtil.registerDualProcessor(QuartzData.class, SpongeQuartzData.class, ImmutableQuartzData.class, ImmutableSpongeQuartzData.class, new QuartzDataProcessor());
    DataUtil.registerDualProcessor(SandData.class, SpongeSandData.class, ImmutableSandData.class, ImmutableSpongeSandData.class, new SandDataProcessor());
    DataUtil.registerDualProcessor(SlabData.class, SpongeSlabData.class, ImmutableSlabData.class, ImmutableSpongeSlabData.class, new SlabDataProcessor());
    DataUtil.registerDualProcessor(SandstoneData.class, SpongeSandstoneData.class, ImmutableSandstoneData.class, ImmutableSpongeSandstoneData.class, new SandstoneDataProcessor());
    DataUtil.registerDualProcessor(ComparatorData.class, SpongeComparatorData.class, ImmutableComparatorData.class, ImmutableSpongeComparatorData.class, new ComparatorDataProcessor());
    DataUtil.registerDualProcessor(TreeData.class, SpongeTreeData.class, ImmutableTreeData.class, ImmutableSpongeTreeData.class, new TreeDataProcessor());
    DataUtil.registerDualProcessor(DisguisedBlockData.class, SpongeDisguisedBlockData.class, ImmutableDisguisedBlockData.class, ImmutableSpongeDisguisedBlockData.class, new DisguisedBlockDataProcessor());
    DataUtil.registerDualProcessor(HingeData.class, SpongeHingeData.class, ImmutableHingeData.class, ImmutableSpongeHingeData.class, new HingeDataProcessor());
    DataUtil.registerDualProcessor(PistonData.class, SpongePistonData.class, ImmutablePistonData.class, ImmutableSpongePistonData.class, new PistonDataProcessor());
    DataUtil.registerDualProcessor(PortionData.class, SpongePortionData.class, ImmutablePortionData.class, ImmutableSpongePortionData.class, new PortionDataProcessor());
    DataUtil.registerDualProcessor(RailDirectionData.class, SpongeRailDirectionData.class, ImmutableRailDirectionData.class, ImmutableSpongeRailDirectionData.class, new RailDirectionDataProcessor());
    DataUtil.registerDualProcessor(StairShapeData.class, SpongeStairShapeData.class, ImmutableStairShapeData.class, ImmutableSpongeStairShapeData.class, new StairShapeDataProcessor());
    DataUtil.registerDualProcessor(WallData.class, SpongeWallData.class, ImmutableWallData.class, ImmutableSpongeWallData.class, new WallDataProcessor());
    DataUtil.registerDualProcessor(ShrubData.class, SpongeShrubData.class, ImmutableShrubData.class, ImmutableSpongeShrubData.class, new ShrubDataProcessor());
    DataUtil.registerDualProcessor(PlantData.class, SpongePlantData.class, ImmutablePlantData.class, ImmutableSpongePlantData.class, new PlantDataProcessor());
    DataUtil.registerDualProcessor(DoublePlantData.class, SpongeDoublePlantData.class, ImmutableDoublePlantData.class, ImmutableSpongeDoublePlantData.class, new DoublePlantDataProcessor());
    DataUtil.registerDualProcessor(BigMushroomData.class, SpongeBigMushroomData.class, ImmutableBigMushroomData.class, ImmutableSpongeBigMushroomData.class, new BigMushroomDataProcessor());
    DataUtil.registerDualProcessor(AttachedData.class, SpongeAttachedData.class, ImmutableAttachedData.class, ImmutableSpongeAttachedData.class, new AttachedDataProcessor());
    DataUtil.registerDataProcessorAndImpl(ConnectedDirectionData.class, SpongeConnectedDirectionData.class, ImmutableConnectedDirectionData.class, ImmutableSpongeConnectedDirectionData.class, new ConnectedDirectionDataProcessor());
    DataUtil.registerDualProcessor(DirectionalData.class, SpongeDirectionalData.class, ImmutableDirectionalData.class, ImmutableSpongeDirectionalData.class, new DirectionalDataProcessor());
    DataUtil.registerDualProcessor(DisarmedData.class, SpongeDisarmedData.class, ImmutableDisarmedData.class, ImmutableSpongeDisarmedData.class, new DisarmedDataProcessor());
    DataUtil.registerDualProcessor(DropData.class, SpongeDropData.class, ImmutableDropData.class, ImmutableSpongeDropData.class, new DropDataProcessor());
    DataUtil.registerDualProcessor(ExtendedData.class, SpongeExtendedData.class, ImmutableExtendedData.class, ImmutableSpongeExtendedData.class, new ExtendedDataProcessor());
    DataUtil.registerDualProcessor(GrowthData.class, SpongeGrowthData.class, ImmutableGrowthData.class, ImmutableSpongeGrowthData.class, new GrowthDataProcessor());
    DataUtil.registerDualProcessor(OpenData.class, SpongeOpenData.class, ImmutableOpenData.class, ImmutableSpongeOpenData.class, new OpenDataProcessor());
    DataUtil.registerDualProcessor(PoweredData.class, SpongePoweredData.class, ImmutablePoweredData.class, ImmutableSpongePoweredData.class, new PoweredDataProcessor());
    DataUtil.registerDualProcessor(RedstonePoweredData.class, SpongeRedstonePoweredData.class, ImmutableRedstonePoweredData.class, ImmutableSpongeRedstonePoweredData.class, new RedstonePoweredDataProcessor());
    DataUtil.registerDualProcessor(SeamlessData.class, SpongeSeamlessData.class, ImmutableSeamlessData.class, ImmutableSpongeSeamlessData.class, new SeamlessDataProcessor());
    DataUtil.registerDualProcessor(SnowedData.class, SpongeSnowedData.class, ImmutableSnowedData.class, ImmutableSpongeSnowedData.class, new SnowedDataProcessor());
    DataUtil.registerDualProcessor(OccupiedData.class, SpongeOccupiedData.class, ImmutableOccupiedData.class, ImmutableSpongeOccupiedData.class, new OccupiedDataProcessor());
    DataUtil.registerDualProcessor(InWallData.class, SpongeInWallData.class, ImmutableInWallData.class, ImmutableSpongeInWallData.class, new InWallDataProcessor());
    DataUtil.registerDualProcessor(LayeredData.class, SpongeLayeredData.class, ImmutableLayeredData.class, ImmutableSpongeLayeredData.class, new LayeredDataProcessor());
    DataUtil.registerDualProcessor(DecayableData.class, SpongeDecayableData.class, ImmutableDecayableData.class, ImmutableSpongeDecayableData.class, new DecayableDataProcessor());
    DataUtil.registerDualProcessor(AxisData.class, SpongeAxisData.class, ImmutableAxisData.class, ImmutableSpongeAxisData.class, new AxisDataProcessor());
    DataUtil.registerDualProcessor(DelayableData.class, SpongeDelayableData.class, ImmutableDelayableData.class, ImmutableSpongeDelayableData.class, new DelayableDataProcessor());
    DataUtil.registerDualProcessor(MoistureData.class, SpongeMoistureData.class, ImmutableMoistureData.class, ImmutableSpongeMoistureData.class, new MoistureDataProcessor());
    // TileEntity Processors
    DataUtil.registerDualProcessor(SkullData.class, SpongeSkullData.class, ImmutableSkullData.class, ImmutableSpongeSkullData.class, new TileEntitySkullDataProcessor());
    DataUtil.registerDualProcessor(RepresentedPlayerData.class, SpongeRepresentedPlayerData.class, ImmutableRepresentedPlayerData.class, ImmutableSpongeRepresentedPlayerData.class, new SkullRepresentedPlayerDataProcessor());
    DataUtil.registerDualProcessor(SignData.class, SpongeSignData.class, ImmutableSignData.class, ImmutableSpongeSignData.class, new TileEntitySignDataProcessor());
    DataUtil.registerDataProcessorAndImpl(FurnaceData.class, SpongeFurnaceData.class, ImmutableFurnaceData.class, ImmutableSpongeFurnaceData.class, new FurnaceDataProcessor());
    DataUtil.registerDualProcessor(BrewingStandData.class, SpongeBrewingStandData.class, ImmutableBrewingStandData.class, ImmutableSpongeBrewingStandData.class, new BrewingStandDataProcessor());
    DataUtil.registerDataProcessorAndImpl(ConnectedDirectionData.class, SpongeConnectedDirectionData.class, ImmutableConnectedDirectionData.class, ImmutableSpongeConnectedDirectionData.class, new TileConnectedDirectionDataProcessor());
    DataUtil.registerDualProcessor(CooldownData.class, SpongeCooldownData.class, ImmutableCooldownData.class, ImmutableSpongeCooldownData.class, new CooldownDataProcessor());
    DataUtil.registerDualProcessor(NoteData.class, SpongeNoteData.class, ImmutableNoteData.class, ImmutableSpongeNoteData.class, new NoteDataProcessor());
    DataUtil.registerDualProcessor(LockableData.class, SpongeLockableData.class, ImmutableLockableData.class, ImmutableSpongeLockableData.class, new TileEntityLockableDataProcessor());
    DataUtil.registerDualProcessor(RepresentedItemData.class, SpongeRepresentedItemData.class, ImmutableRepresentedItemData.class, ImmutableSpongeRepresentedItemData.class, new JukeboxDataProcessor());
    DataUtil.registerDualProcessor(RepresentedItemData.class, SpongeRepresentedItemData.class, ImmutableRepresentedItemData.class, ImmutableSpongeRepresentedItemData.class, new FlowerPotDataProcessor());
    DataUtil.registerDataProcessorAndImpl(BannerData.class, SpongeBannerData.class, ImmutableBannerData.class, ImmutableSpongeBannerData.class, new TileEntityBannerDataProcessor());
    DataUtil.registerDataProcessorAndImpl(BannerData.class, SpongeBannerData.class, ImmutableBannerData.class, ImmutableSpongeBannerData.class, new ShieldBannerDataProcessor());
    DataUtil.registerDataProcessorAndImpl(CommandData.class, SpongeCommandData.class, ImmutableCommandData.class, ImmutableSpongeCommandData.class, new TileEntityCommandDataProcessor());
    DataUtil.registerDualProcessor(DirectionalData.class, SpongeDirectionalData.class, ImmutableDirectionalData.class, ImmutableSpongeDirectionalData.class, new SkullRotationDataProcessor());
    DataUtil.registerDualProcessor(DirectionalData.class, SpongeDirectionalData.class, ImmutableDirectionalData.class, ImmutableSpongeDirectionalData.class, new HangingDataProcessor());
    DataUtil.registerDataProcessorAndImpl(BeaconData.class, SpongeBeaconData.class, ImmutableBeaconData.class, ImmutableSpongeBeaconData.class, new BeaconDataProcessor());
    DataUtil.registerDataProcessorAndImpl(EndGatewayData.class, SpongeEndGatewayData.class, ImmutableEndGatewayData.class, ImmutableSpongeEndGatewayData.class, new EndGatewayDataProcessor());
    DataUtil.registerDataProcessorAndImpl(StructureData.class, SpongeStructureData.class, ImmutableStructureData.class, ImmutableSpongeStructureData.class, new StructureDataProcessor());
    DataUtil.registerDataProcessorAndImpl(MobSpawnerData.class, SpongeMobSpawnerData.class, ImmutableMobSpawnerData.class, ImmutableSpongeMobSpawnerData.class, new MobSpawnerDataProcessor());
    DataUtil.registerDualProcessor(HealthScalingData.class, SpongeHealthScaleData.class, ImmutableHealthScalingData.class, ImmutableSpongeHealthScalingData.class, new HealthScalingProcessor());
    DataUtil.registerDualProcessor(DyeableData.class, SpongeDyeableData.class, ImmutableDyeableData.class, ImmutableSpongeDyeableData.class, new BedDyeColorDataProcessor());
    // Values
    DataUtil.registerValueProcessor(Keys.FUSE_DURATION, new FuseDurationValueProcessor());
    DataUtil.registerValueProcessor(Keys.TICKS_REMAINING, new TicksRemainingValueProcessor());
    DataUtil.registerValueProcessor(Keys.HEALTH, new HealthValueProcessor());
    DataUtil.registerValueProcessor(Keys.MAX_HEALTH, new MaxHealthValueProcessor());
    DataUtil.registerValueProcessor(Keys.FIRE_TICKS, new FireTicksValueProcessor());
    DataUtil.registerValueProcessor(Keys.FIRE_DAMAGE_DELAY, new FireDamageDelayValueProcessor());
    DataUtil.registerValueProcessor(Keys.DISPLAY_NAME, new ItemDisplayNameValueProcessor());
    DataUtil.registerValueProcessor(Keys.DISPLAY_NAME, new TileEntityDisplayNameValueProcessor());
    DataUtil.registerValueProcessor(Keys.DISPLAY_NAME, new EntityDisplayNameValueProcessor());
    DataUtil.registerValueProcessor(Keys.FOOD_LEVEL, new FoodLevelValueProcessor());
    DataUtil.registerValueProcessor(Keys.SATURATION, new FoodSaturationValueProcessor());
    DataUtil.registerValueProcessor(Keys.EXHAUSTION, new FoodExhaustionValueProcessor());
    DataUtil.registerValueProcessor(Keys.MAX_AIR, new MaxAirValueProcessor());
    DataUtil.registerValueProcessor(Keys.REMAINING_AIR, new RemainingAirValueProcessor());
    DataUtil.registerValueProcessor(Keys.HORSE_COLOR, new HorseColorValueProcessor());
    DataUtil.registerValueProcessor(Keys.HORSE_STYLE, new HorseStyleValueProcessor());
    DataUtil.registerValueProcessor(Keys.EXPERIENCE_LEVEL, new ExperienceLevelValueProcessor());
    DataUtil.registerValueProcessor(Keys.TOTAL_EXPERIENCE, new TotalExperienceValueProcessor());
    DataUtil.registerValueProcessor(Keys.EXPERIENCE_SINCE_LEVEL, new ExperienceSinceLevelValueProcessor());
    DataUtil.registerValueProcessor(Keys.EXPERIENCE_FROM_START_OF_LEVEL, new ExperienceFromStartOfLevelValueProcessor());
    DataUtil.registerValueProcessor(Keys.WALKING_SPEED, new WalkingSpeedValueProcessor());
    DataUtil.registerValueProcessor(Keys.FLYING_SPEED, new FlyingSpeedValueProcessor());
    DataUtil.registerValueProcessor(Keys.PASSED_BURN_TIME, new PassedBurnTimeValueProcessor());
    DataUtil.registerValueProcessor(Keys.MAX_BURN_TIME, new MaxBurnTimeValueProcessor());
    DataUtil.registerValueProcessor(Keys.PASSED_COOK_TIME, new PassedCookTimeValueProcessor());
    DataUtil.registerValueProcessor(Keys.MAX_COOK_TIME, new MaxCookTimeValueProcessor());
    DataUtil.registerValueProcessor(Keys.UNBREAKABLE, new UnbreakableValueProcessor());
    DataUtil.registerValueProcessor(Keys.ITEM_DURABILITY, new ItemDurabilityValueProcessor());
    DataUtil.registerValueProcessor(Keys.VEHICLE, new VehicleValueProcessor());
    DataUtil.registerValueProcessor(Keys.BASE_VEHICLE, new BaseVehicleValueProcessor());
    DataUtil.registerValueProcessor(Keys.REPRESENTED_BLOCK, new RepresentedBlockValueProcessor());
    DataUtil.registerValueProcessor(Keys.OFFSET, new OffsetValueProcessor());
    DataUtil.registerValueProcessor(Keys.FALL_DAMAGE_PER_BLOCK, new FallHurtAmountValueProcessor());
    DataUtil.registerValueProcessor(Keys.MAX_FALL_DAMAGE, new MaxFallDamageValueProcessor());
    DataUtil.registerValueProcessor(Keys.FALLING_BLOCK_STATE, new FallingBlockStateValueProcessor());
    DataUtil.registerValueProcessor(Keys.CAN_PLACE_AS_BLOCK, new CanPlaceAsBlockValueProcessor());
    DataUtil.registerValueProcessor(Keys.CAN_DROP_AS_ITEM, new CanDropAsItemValueProcessor());
    DataUtil.registerValueProcessor(Keys.FALL_TIME, new FallTimeValueProcessor());
    DataUtil.registerValueProcessor(Keys.FALLING_BLOCK_CAN_HURT_ENTITIES, new FallingBlockCanHurtEntitiesValueProcessor());
    DataUtil.registerValueProcessor(Keys.CONNECTED_DIRECTIONS, new ConnectedDirectionsValueProcessor());
    DataUtil.registerValueProcessor(Keys.CONNECTED_EAST, new ConnectedEastValueProcessor());
    DataUtil.registerValueProcessor(Keys.CONNECTED_NORTH, new ConnectedNorthValueProcessor());
    DataUtil.registerValueProcessor(Keys.CONNECTED_SOUTH, new ConnectedSouthValueProcessor());
    DataUtil.registerValueProcessor(Keys.CONNECTED_WEST, new ConnectedWestValueProcessor());
    DataUtil.registerValueProcessor(Keys.BANNER_BASE_COLOR, new TileBannerBaseColorValueProcessor());
    DataUtil.registerValueProcessor(Keys.BANNER_PATTERNS, new TileBannerPatternLayersValueProcessor());
    DataUtil.registerValueProcessor(Keys.LAST_COMMAND_OUTPUT, new EntityLastCommandOutputValueProcessor());
    DataUtil.registerValueProcessor(Keys.LAST_COMMAND_OUTPUT, new TileEntityLastCommandOutputValueProcessor());
    DataUtil.registerValueProcessor(Keys.COMMAND, new EntityCommandValueProcessor());
    DataUtil.registerValueProcessor(Keys.COMMAND, new TileEntityCommandValueProcessor());
    DataUtil.registerValueProcessor(Keys.SUCCESS_COUNT, new EntitySuccessCountValueProcessor());
    DataUtil.registerValueProcessor(Keys.SUCCESS_COUNT, new TileEntitySuccessCountValueProcessor());
    DataUtil.registerValueProcessor(Keys.TRACKS_OUTPUT, new EntityTracksOutputValueProcessor());
    DataUtil.registerValueProcessor(Keys.TRACKS_OUTPUT, new TileEntityTracksOutputValueProcessor());
    DataUtil.registerValueProcessor(Keys.INVISIBLE, new InvisibilityValueProcessor());
    DataUtil.registerValueProcessor(Keys.VANISH, new VanishValueProcessor());
    DataUtil.registerValueProcessor(Keys.VANISH_IGNORES_COLLISION, new VanishCollisionValueProcessor());
    DataUtil.registerValueProcessor(Keys.VANISH_PREVENTS_TARGETING, new VanishTargetValueProcessor());
    DataUtil.registerValueProcessor(Keys.FIRST_DATE_PLAYED, new FirstJoinValueProcessor());
    DataUtil.registerValueProcessor(Keys.LAST_DATE_PLAYED, new LastPlayedValueProcessor());
    DataUtil.registerValueProcessor(Keys.HIDE_ENCHANTMENTS, new HideEnchantmentsValueProcessor());
    DataUtil.registerValueProcessor(Keys.HIDE_ATTRIBUTES, new HideAttributesValueProcessor());
    DataUtil.registerValueProcessor(Keys.HIDE_UNBREAKABLE, new HideUnbreakableValueProcessor());
    DataUtil.registerValueProcessor(Keys.HIDE_CAN_DESTROY, new HideCanDestroyValueProcessor());
    DataUtil.registerValueProcessor(Keys.HIDE_CAN_PLACE, new HideCanPlaceValueProcessor());
    DataUtil.registerValueProcessor(Keys.HIDE_MISCELLANEOUS, new HideMiscellaneousValueProcessor());
    DataUtil.registerValueProcessor(Keys.BODY_ROTATIONS, new BodyRotationsValueProcessor());
    DataUtil.registerValueProcessor(Keys.HEAD_ROTATION, new HeadRotationValueProcessor());
    DataUtil.registerValueProcessor(Keys.CHEST_ROTATION, new ChestRotationValueProcessor());
    DataUtil.registerValueProcessor(Keys.LEFT_ARM_ROTATION, new LeftArmRotationValueProcessor());
    DataUtil.registerValueProcessor(Keys.RIGHT_ARM_ROTATION, new RightArmRotationValueProcessor());
    DataUtil.registerValueProcessor(Keys.LEFT_LEG_ROTATION, new LeftLegRotationValueProcessor());
    DataUtil.registerValueProcessor(Keys.RIGHT_LEG_ROTATION, new RightLegRotationValueProcessor());
    DataUtil.registerValueProcessor(Keys.BEACON_PRIMARY_EFFECT, new BeaconPrimaryEffectValueProcessor());
    DataUtil.registerValueProcessor(Keys.BEACON_SECONDARY_EFFECT, new BeaconSecondaryEffectValueProcessor());
    DataUtil.registerValueProcessor(Keys.ARMOR_STAND_HAS_BASE_PLATE, new ArmorStandBasePlateValueProcessor());
    DataUtil.registerValueProcessor(Keys.ARMOR_STAND_MARKER, new ArmorStandMarkerValueProcessor());
    DataUtil.registerValueProcessor(Keys.ARMOR_STAND_IS_SMALL, new ArmorStandSmallValueProcessor());
    DataUtil.registerValueProcessor(Keys.ARMOR_STAND_HAS_ARMS, new ArmorStandArmsValueProcessor());
    DataUtil.registerValueProcessor(Keys.PICKUP_DELAY, new PickupDelayValueProcessor());
    DataUtil.registerValueProcessor(Keys.INFINITE_PICKUP_DELAY, new InfinitePickupDelayValueProcessor());
    DataUtil.registerValueProcessor(Keys.DESPAWN_DELAY, new DespawnDelayValueProcessor());
    DataUtil.registerValueProcessor(Keys.INFINITE_DESPAWN_DELAY, new InfiniteDespawnDelayValueProcessor());
    DataUtil.registerValueProcessor(Keys.SPAWNER_REMAINING_DELAY, new SpawnerRemainingDelayValueProcessor());
    DataUtil.registerValueProcessor(Keys.SPAWNER_MINIMUM_DELAY, new SpawnerMinimumDelayValueProcessor());
    DataUtil.registerValueProcessor(Keys.SPAWNER_MAXIMUM_DELAY, new SpawnerMaximumDelayValueProcessor());
    DataUtil.registerValueProcessor(Keys.SPAWNER_SPAWN_COUNT, new SpawnerSpawnCountValueProcessor());
    DataUtil.registerValueProcessor(Keys.SPAWNER_MAXIMUM_NEARBY_ENTITIES, new SpawnerMaximumNearbyEntitiesValueProcessor());
    DataUtil.registerValueProcessor(Keys.SPAWNER_REQUIRED_PLAYER_RANGE, new SpawnerRequiredPlayerRangeValueProcessor());
    DataUtil.registerValueProcessor(Keys.SPAWNER_SPAWN_RANGE, new SpawnerSpawnRangeValueProcessor());
    DataUtil.registerValueProcessor(Keys.SPAWNER_NEXT_ENTITY_TO_SPAWN, new SpawnerNextEntityToSpawnValueProcessor());
    DataUtil.registerValueProcessor(Keys.SPAWNER_ENTITIES, new SpawnerEntitiesValueProcessor());
    DataUtil.registerValueProcessor(Keys.AREA_EFFECT_CLOUD_COLOR, new AreaEffectCloudColorProcessor());
    DataUtil.registerValueProcessor(Keys.AREA_EFFECT_CLOUD_AGE, new AreaEffectCloudAgeProcessor());
    DataUtil.registerValueProcessor(Keys.AREA_EFFECT_CLOUD_PARTICLE_TYPE, new AreaEffectCloudParticleTypeProcessor());
    DataUtil.registerValueProcessor(Keys.AREA_EFFECT_CLOUD_DURATION, new AreaEffectCloudDurationProcessor());
    DataUtil.registerValueProcessor(Keys.AREA_EFFECT_CLOUD_DURATION_ON_USE, new AreaEffectCloudDurationOnUseProcessor());
    DataUtil.registerValueProcessor(Keys.AREA_EFFECT_CLOUD_RADIUS, new AreaEffectCloudRadiusProcessor());
    DataUtil.registerValueProcessor(Keys.AREA_EFFECT_CLOUD_RADIUS_ON_USE, new AreaEffectCloudRadiusOnUseProcessor());
    DataUtil.registerValueProcessor(Keys.AREA_EFFECT_CLOUD_WAIT_TIME, new AreaEffectCloudWaitTimeProcessor());
    DataUtil.registerValueProcessor(Keys.POTION_EFFECTS, new AreaEffectCloudPotionEffectsProcessor());
    DataUtil.registerValueProcessor(Keys.IS_ADULT, new IsAdultValueProcessor());
    DataUtil.registerValueProcessor(Keys.IS_ADULT, new IsAdultZombieValueProcessor());
    DataUtil.registerValueProcessor(Keys.AGE, new AgeableAgeValueProcessor());
    DataUtil.registerValueProcessor(Keys.INVULNERABILITY_TICKS, new InvulnerabilityTicksValueProcessor());
    DataUtil.registerValueProcessor(Keys.INVULNERABLE, new InvulnerableValueProcessor());
    DataUtil.registerValueProcessor(Keys.LAST_ATTACKER, new LastAttackerValueProcessor());
    DataUtil.registerValueProcessor(Keys.LAST_DAMAGE, new LastDamageValueProcessor());
    // Properties
    final PropertyRegistry propertyRegistry = Sponge.getPropertyRegistry();
    // Blocks
    propertyRegistry.register(BlastResistanceProperty.class, new BlastResistancePropertyStore());
    propertyRegistry.register(FlammableProperty.class, new FlammablePropertyStore());
    propertyRegistry.register(GravityAffectedProperty.class, new GravityAffectedPropertyStore());
    propertyRegistry.register(GroundLuminanceProperty.class, new GroundLuminancePropertyStore());
    propertyRegistry.register(HardnessProperty.class, new HardnessPropertyStore());
    propertyRegistry.register(HeldItemProperty.class, new HeldItemPropertyStore());
    propertyRegistry.register(IndirectlyPoweredProperty.class, new IndirectlyPoweredPropertyStore());
    propertyRegistry.register(LightEmissionProperty.class, new LightEmissionPropertyStore());
    propertyRegistry.register(MatterProperty.class, new MatterPropertyStore());
    propertyRegistry.register(PassableProperty.class, new PassablePropertyStore());
    propertyRegistry.register(PoweredProperty.class, new PoweredPropertyStore());
    propertyRegistry.register(ReplaceableProperty.class, new ReplaceablePropertyStore());
    propertyRegistry.register(SkyLuminanceProperty.class, new SkyLuminancePropertyStore());
    propertyRegistry.register(SolidCubeProperty.class, new SolidCubePropertyStore());
    propertyRegistry.register(StatisticsTrackedProperty.class, new StatisticsTrackedPropertyStore());
    propertyRegistry.register(TemperatureProperty.class, new TemperaturePropertyStore());
    propertyRegistry.register(UnbreakableProperty.class, new UnbreakablePropertyStore());
    propertyRegistry.register(SurrogateBlockProperty.class, new SurrogateBlockPropertyStore());
    propertyRegistry.register(FullBlockSelectionBoxProperty.class, new FullBlockSelectionBoxPropertyStore());
    propertyRegistry.register(InstrumentProperty.class, new InstrumentPropertyStore());
    // Items
    propertyRegistry.register(ApplicableEffectProperty.class, new ApplicableEffectPropertyStore());
    propertyRegistry.register(BurningFuelProperty.class, new BurningFuelPropertyStore());
    propertyRegistry.register(DamageAbsorptionProperty.class, new DamageAbsorptionPropertyStore());
    propertyRegistry.register(EfficiencyProperty.class, new EfficiencyPropertyStore());
    propertyRegistry.register(EquipmentProperty.class, new EquipmentPropertyStore());
    propertyRegistry.register(FoodRestorationProperty.class, new FoodRestorationPropertyStore());
    propertyRegistry.register(HarvestingProperty.class, new HarvestingPropertyStore());
    propertyRegistry.register(SaturationProperty.class, new SaturationPropertyStore());
    propertyRegistry.register(UseLimitProperty.class, new UseLimitPropertyStore());
    propertyRegistry.register(ToolTypeProperty.class, new ToolTypePropertyStore());
    propertyRegistry.register(ArmorTypeProperty.class, new ArmorTypePropertyStore());
    propertyRegistry.register(SmeltableProperty.class, new SmeltablePropertyStore());
    propertyRegistry.register(RecordProperty.class, new RecordPropertyStore());
    // Entities
    propertyRegistry.register(EyeLocationProperty.class, new EyeLocationPropertyStore());
    propertyRegistry.register(EyeHeightProperty.class, new EyeHeightPropertyStore());
}
Also used : BaseAndAdditionBuilder(org.spongepowered.common.data.builder.util.weighted.BaseAndAdditionBuilder) VariableAmount(org.spongepowered.api.util.weighted.VariableAmount) OptionalVarianceBuilder(org.spongepowered.common.data.builder.util.weighted.OptionalVarianceBuilder) ImmutableSpongeTreeDataBuilder(org.spongepowered.common.data.builder.manipulator.immutable.block.ImmutableSpongeTreeDataBuilder) BaseAndVarianceBuilder(org.spongepowered.common.data.builder.util.weighted.BaseAndVarianceBuilder) SpongeBlockSnapshotBuilder(org.spongepowered.common.block.SpongeBlockSnapshotBuilder) SpongeFireworkEffectDataBuilder(org.spongepowered.common.data.builder.item.SpongeFireworkEffectDataBuilder) PropertyRegistry(org.spongepowered.api.data.property.PropertyRegistry) LocationBuilder(org.spongepowered.common.data.builder.world.LocationBuilder) SpongeEntitySnapshotBuilder(org.spongepowered.common.entity.SpongeEntitySnapshotBuilder) SpongeGameProfileBuilder(org.spongepowered.common.data.builder.authlib.SpongeGameProfileBuilder) SpongeItemStackBuilder(org.spongepowered.common.item.inventory.SpongeItemStackBuilder) LegacyCustomDataClassContentUpdater(org.spongepowered.common.data.util.LegacyCustomDataClassContentUpdater) SpongeBlockStateMetaContentUpdater(org.spongepowered.common.data.builder.block.state.SpongeBlockStateMetaContentUpdater) ImmutableItemEnchantmentDataBuilder(org.spongepowered.common.data.builder.manipulator.immutable.item.ImmutableItemEnchantmentDataBuilder) BookViewDataBuilder(org.spongepowered.api.text.serializer.BookViewDataBuilder) InvisibilityDataAddVanishUpdater(org.spongepowered.common.data.builder.manipulator.InvisibilityDataAddVanishUpdater) SpongePlayerData(org.spongepowered.common.world.storage.SpongePlayerData) Location(org.spongepowered.api.world.Location) FluidItemDataProcessor(org.spongepowered.common.data.processor.data.extra.FluidItemDataProcessor) FixedBuilder(org.spongepowered.common.data.builder.util.weighted.FixedBuilder) SpongePatternLayerBuilder(org.spongepowered.common.data.builder.meta.SpongePatternLayerBuilder) SpongeEnchantmentBuilder(org.spongepowered.common.item.enchantment.SpongeEnchantmentBuilder) TextConfigSerializer(org.spongepowered.api.text.serializer.TextConfigSerializer) SpongeBlockStateBuilder(org.spongepowered.common.block.SpongeBlockStateBuilder) SpongeParticleEffectBuilder(org.spongepowered.common.effect.particle.SpongeParticleEffectBuilder) SpongeLocatableBlockBuilder(org.spongepowered.common.world.SpongeLocatableBlockBuilder) PotionEffectContentUpdater(org.spongepowered.common.effect.potion.PotionEffectContentUpdater)

Example 30 with Location

use of org.spongepowered.api.world.Location in project Skree by Skelril.

the class TeleportCommand method execute.

@Override
public CommandResult execute(CommandSource src, CommandContext args) throws CommandException {
    Player target;
    if (src instanceof Player) {
        target = (Player) src;
    } else {
        src.sendMessage(Text.of(TextColors.RED, "You are not a player and teleporting other players is not currently supported!"));
        return CommandResult.empty();
    }
    Optional<Vector3d> dest = args.getOne("dest");
    Vector3d rotation = new Vector3d(0, 0, 0);
    World targetExtent = target.getWorld();
    String destStr;
    if (dest.isPresent()) {
        if (!src.hasPermission("skree.teleport.teleport.coord")) {
            src.sendMessage(Text.of(TextColors.RED, "You do not have permission to teleport by coordinates here."));
            return CommandResult.empty();
        }
        destStr = dest.get().toString();
    } else {
        if (!src.hasPermission("skree.teleport.teleport.player")) {
            src.sendMessage(Text.of(TextColors.RED, "You do not have permission to teleport to players here."));
            return CommandResult.empty();
        }
        Player player = args.<Player>getOne("dest-player").get();
        targetExtent = player.getWorld();
        rotation = player.getRotation();
        dest = Optional.of(player.getLocation().getPosition());
        destStr = player.getName();
    }
    Optional<Location<World>> optSafeDest = SafeTeleportHelper.getSafeDest(target, new Location<>(targetExtent, dest.get()));
    if (optSafeDest.isPresent()) {
        if (!WorldEntryPermissionCheck.checkDestination(target, optSafeDest.get().getExtent())) {
            src.sendMessage(Text.of(TextColors.RED, "You do not have permission to access worlds of this type."));
            return CommandResult.empty();
        }
        target.setLocationAndRotation(optSafeDest.get(), rotation);
        src.sendMessage(Text.of(TextColors.YELLOW, "Teleported to " + destStr + '.'));
    } else {
        src.sendMessage(Text.of(TextColors.RED, "The requested destination is unsafe."));
    }
    return CommandResult.success();
}
Also used : Player(org.spongepowered.api.entity.living.player.Player) Vector3d(com.flowpowered.math.vector.Vector3d) World(org.spongepowered.api.world.World) Location(org.spongepowered.api.world.Location)

Aggregations

Location (org.spongepowered.api.world.Location)166 World (org.spongepowered.api.world.World)96 Listener (org.spongepowered.api.event.Listener)44 Player (org.spongepowered.api.entity.living.player.Player)40 Vector3d (com.flowpowered.math.vector.Vector3d)38 BlockSnapshot (org.spongepowered.api.block.BlockSnapshot)32 Vector3i (com.flowpowered.math.vector.Vector3i)31 Optional (java.util.Optional)28 Entity (org.spongepowered.api.entity.Entity)27 BlockType (org.spongepowered.api.block.BlockType)24 BlockState (org.spongepowered.api.block.BlockState)23 ItemStack (org.spongepowered.api.item.inventory.ItemStack)23 Direction (org.spongepowered.api.util.Direction)21 ArrayList (java.util.ArrayList)20 Keys (org.spongepowered.api.data.key.Keys)20 List (java.util.List)19 Text (org.spongepowered.api.text.Text)19 BlockPos (net.minecraft.util.math.BlockPos)18 Sponge (org.spongepowered.api.Sponge)15 Map (java.util.Map)14