Search in sources :

Example 56 with IMixinWorldServer

use of org.spongepowered.common.interfaces.world.IMixinWorldServer in project SpongeCommon by SpongePowered.

the class EntityActivationRange method initializeEntityActivationState.

/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity Entity to check
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity) {
    if (((IMixinWorld) entity.world).isFake()) {
        return true;
    }
    // types that should always be active
    if (entity instanceof EntityPlayer && !SpongeImplHooks.isFakePlayer(entity) || entity instanceof EntityThrowable || entity instanceof EntityDragon || entity instanceof MultiPartEntityPart || entity instanceof EntityWither || entity instanceof EntityFireball || entity instanceof EntityWeatherEffect || entity instanceof EntityTNTPrimed || entity instanceof EntityEnderCrystal || entity instanceof EntityFireworkRocket || // Always tick falling blocks
    entity instanceof EntityFallingBlock) {
        return true;
    }
    EntityActivationRangeCategory config = ((IMixinWorldServer) entity.world).getActiveConfig().getConfig().getEntityActivationRange();
    EntityType type = ((org.spongepowered.api.entity.Entity) entity).getType();
    IModData_Activation spongeEntity = (IModData_Activation) entity;
    if (type == EntityTypes.UNKNOWN || !(type instanceof SpongeEntityType)) {
        return false;
    }
    final SpongeEntityType spongeType = (SpongeEntityType) type;
    final byte activationType = spongeEntity.getActivationType();
    if (!spongeType.isActivationRangeInitialized()) {
        addEntityToConfig(entity.world, spongeType, activationType);
        spongeType.setActivationRangeInitialized(true);
    }
    EntityActivationModCategory entityMod = config.getModList().get(spongeType.getModId().toLowerCase());
    int defaultActivationRange = config.getDefaultRanges().get(activationTypeMappings.get(activationType));
    if (entityMod == null) {
        // use default activation range
        spongeEntity.setActivationRange(defaultActivationRange);
        if (defaultActivationRange <= 0) {
            return true;
        }
        return false;
    } else if (!entityMod.isEnabled()) {
        spongeEntity.setActivationRange(defaultActivationRange);
        return true;
    }
    Integer defaultModActivationRange = entityMod.getDefaultRanges().get(activationTypeMappings.get(activationType));
    Integer entityActivationRange = entityMod.getEntityList().get(type.getName().toLowerCase());
    if (defaultModActivationRange != null && entityActivationRange == null) {
        spongeEntity.setActivationRange(defaultModActivationRange);
        if (defaultModActivationRange <= 0) {
            return true;
        }
        return false;
    } else if (entityActivationRange != null) {
        spongeEntity.setActivationRange(entityActivationRange);
        if (entityActivationRange <= 0) {
            return true;
        }
    }
    return false;
}
Also used : EntityThrowable(net.minecraft.entity.projectile.EntityThrowable) EntityDragon(net.minecraft.entity.boss.EntityDragon) IMixinEntity(org.spongepowered.common.interfaces.entity.IMixinEntity) Entity(net.minecraft.entity.Entity) IModData_Activation(org.spongepowered.common.mixin.plugin.entityactivation.interfaces.IModData_Activation) EntityFallingBlock(net.minecraft.entity.item.EntityFallingBlock) EntityTNTPrimed(net.minecraft.entity.item.EntityTNTPrimed) EntityWeatherEffect(net.minecraft.entity.effect.EntityWeatherEffect) EntityEnderCrystal(net.minecraft.entity.item.EntityEnderCrystal) MultiPartEntityPart(net.minecraft.entity.MultiPartEntityPart) IMixinWorldServer(org.spongepowered.common.interfaces.world.IMixinWorldServer) SpongeEntityType(org.spongepowered.common.entity.SpongeEntityType) EntityType(org.spongepowered.api.entity.EntityType) IMixinWorld(org.spongepowered.common.interfaces.world.IMixinWorld) EntityFireworkRocket(net.minecraft.entity.item.EntityFireworkRocket) SpongeEntityType(org.spongepowered.common.entity.SpongeEntityType) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EntityWither(net.minecraft.entity.boss.EntityWither) EntityActivationRangeCategory(org.spongepowered.common.config.category.EntityActivationRangeCategory) EntityActivationModCategory(org.spongepowered.common.config.category.EntityActivationModCategory) EntityFireball(net.minecraft.entity.projectile.EntityFireball)

Example 57 with IMixinWorldServer

use of org.spongepowered.common.interfaces.world.IMixinWorldServer in project SpongeCommon by SpongePowered.

the class TileEntityActivation method initializeTileEntityActivationState.

/**
 * These tileentities are excluded from Activation range checks.
 *
 * @param tileEntity The tileentity to check
 * @return boolean If it should always tick.
 */
public static boolean initializeTileEntityActivationState(TileEntity tileEntity) {
    if (tileEntity.getWorld() == null || tileEntity.getWorld().isRemote || !(tileEntity instanceof ITickable)) {
        return true;
    }
    TileEntityActivationCategory config = ((IMixinWorldServer) tileEntity.getWorld()).getActiveConfig().getConfig().getTileEntityActivationRange();
    TileEntityType type = ((org.spongepowered.api.block.tileentity.TileEntity) tileEntity).getType();
    IModData_Activation spongeTileEntity = (IModData_Activation) tileEntity;
    SpongeTileEntityType spongeType = (SpongeTileEntityType) type;
    if (spongeType == null || spongeType.getModId() == null) {
        return true;
    }
    TileEntityActivationModCategory tileEntityMod = config.getModList().get(spongeType.getModId().toLowerCase());
    int defaultActivationRange = config.getDefaultBlockRange();
    int defaultTickRate = config.getDefaultTickRate();
    if (tileEntityMod == null) {
        // use default activation range
        spongeTileEntity.setActivationRange(defaultActivationRange);
        if (defaultActivationRange <= 0) {
            return true;
        }
        return false;
    } else if (!tileEntityMod.isEnabled()) {
        spongeTileEntity.setActivationRange(defaultActivationRange);
        spongeTileEntity.setSpongeTickRate(defaultTickRate);
        return true;
    }
    Integer defaultModActivationRange = tileEntityMod.getDefaultBlockRange();
    Integer tileEntityActivationRange = tileEntityMod.getTileEntityRangeList().get(type.getName().toLowerCase());
    if (defaultModActivationRange != null && tileEntityActivationRange == null) {
        spongeTileEntity.setActivationRange(defaultModActivationRange);
        if (defaultModActivationRange <= 0) {
            return true;
        }
    } else if (tileEntityActivationRange != null) {
        spongeTileEntity.setActivationRange(tileEntityActivationRange);
        if (tileEntityActivationRange <= 0) {
            return true;
        }
    }
    Integer defaultModTickRate = tileEntityMod.getDefaultTickRate();
    Integer tileEntityTickRate = tileEntityMod.getTileEntityTickRateList().get(type.getName().toLowerCase());
    if (defaultModTickRate != null && tileEntityTickRate == null) {
        spongeTileEntity.setSpongeTickRate(defaultModTickRate);
        if (defaultModTickRate <= 0) {
            return true;
        }
        return false;
    } else if (tileEntityTickRate != null) {
        spongeTileEntity.setSpongeTickRate(tileEntityTickRate);
        if (tileEntityTickRate <= 0) {
            return true;
        }
    }
    return false;
}
Also used : IMixinTileEntity(org.spongepowered.common.interfaces.block.tile.IMixinTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) IModData_Activation(org.spongepowered.common.mixin.plugin.entityactivation.interfaces.IModData_Activation) TileEntityActivationModCategory(org.spongepowered.common.config.category.TileEntityActivationModCategory) ITickable(net.minecraft.util.ITickable) SpongeTileEntityType(org.spongepowered.common.data.type.SpongeTileEntityType) SpongeTileEntityType(org.spongepowered.common.data.type.SpongeTileEntityType) TileEntityType(org.spongepowered.api.block.tileentity.TileEntityType) TileEntityActivationCategory(org.spongepowered.common.config.category.TileEntityActivationCategory) IMixinWorldServer(org.spongepowered.common.interfaces.world.IMixinWorldServer)

Example 58 with IMixinWorldServer

use of org.spongepowered.common.interfaces.world.IMixinWorldServer in project SpongeCommon by SpongePowered.

the class MixinWorldEntitySpawner method findChunksForSpawning.

/**
 * @author blood - February 18th, 2017
 * @reason Refactor entire method for optimizations and spawn limits.
 *
 * @param worldServerIn The world
 * @param spawnHostileMobs If hostile entities can spawn
 * @param spawnPeacefulMobs If passive entities can spawn
 * @param spawnOnSetTickRate If tickrate has been reached for spawning passives
 * @return The amount of entities spawned
 */
@Overwrite
public int findChunksForSpawning(WorldServer worldServerIn, boolean spawnHostileMobs, boolean spawnPeacefulMobs, boolean spawnOnSetTickRate) {
    if (!spawnHostileMobs && !spawnPeacefulMobs) {
        return 0;
    }
    try (PhaseContext<?> context = GenerationPhase.State.WORLD_SPAWNER_SPAWNING.createPhaseContext().world(worldServerIn).buildAndSwitch()) {
        Iterator<Chunk> chunkIterator = this.eligibleSpawnChunks.iterator();
        while (chunkIterator.hasNext()) {
            Chunk chunk = chunkIterator.next();
            ((IMixinChunk) chunk).setIsSpawning(false);
            chunkIterator.remove();
        }
        IMixinWorldServer spongeWorld = ((IMixinWorldServer) worldServerIn);
        spongeWorld.getTimingsHandler().mobSpawn.startTiming();
        int chunkSpawnCandidates = 0;
        final int mobSpawnRange = Math.min(((IMixinWorldServer) worldServerIn).getActiveConfig().getConfig().getWorld().getMobSpawnRange(), ((org.spongepowered.api.world.World) worldServerIn).getViewDistance());
        // Vanilla uses a div count of 289 (17x17) which assumes the view distance is 8.
        // Since we allow for custom ranges, we need to adjust the div count based on the
        // mob spawn range set by server.
        final int MOB_SPAWN_COUNT_DIV = (2 * mobSpawnRange + 1) * (2 * mobSpawnRange + 1);
        for (EntityPlayer entityplayer : worldServerIn.playerEntities) {
            // We treat players who do not affect spawning as "spectators"
            if (!((IMixinEntityPlayer) entityplayer).affectsSpawning() || entityplayer.isSpectator()) {
                continue;
            }
            int playerPosX = MathHelper.floor(entityplayer.posX / 16.0D);
            int playerPosZ = MathHelper.floor(entityplayer.posZ / 16.0D);
            for (int i = -mobSpawnRange; i <= mobSpawnRange; ++i) {
                for (int j = -mobSpawnRange; j <= mobSpawnRange; ++j) {
                    boolean flag = i == -mobSpawnRange || i == mobSpawnRange || j == -mobSpawnRange || j == mobSpawnRange;
                    final Chunk chunk = ((IMixinChunkProviderServer) worldServerIn.getChunkProvider()).getLoadedChunkWithoutMarkingActive(i + playerPosX, j + playerPosZ);
                    if (chunk == null || (chunk.unloadQueued && !((IMixinChunk) chunk).isPersistedChunk())) {
                        // Don't attempt to spawn in an unloaded chunk
                        continue;
                    }
                    final IMixinChunk spongeChunk = (IMixinChunk) chunk;
                    ++chunkSpawnCandidates;
                    final ChunkPos chunkPos = chunk.getPos();
                    if (!flag && worldServerIn.getWorldBorder().contains(chunkPos)) {
                        PlayerChunkMapEntry playerchunkmapentry = worldServerIn.getPlayerChunkMap().getEntry(chunkPos.x, chunkPos.z);
                        if (playerchunkmapentry != null && playerchunkmapentry.isSentToPlayers() && !spongeChunk.isSpawning()) {
                            this.eligibleSpawnChunks.add(chunk);
                            spongeChunk.setIsSpawning(true);
                        }
                    }
                }
            }
        }
        // If there are no eligible chunks, return early
        if (this.eligibleSpawnChunks.size() == 0) {
            spongeWorld.getTimingsHandler().mobSpawn.stopTiming();
            return 0;
        }
        int totalSpawned = 0;
        final long worldTotalTime = worldServerIn.getTotalWorldTime();
        final SpongeConfig<? extends GeneralConfigBase> activeConfig = ((IMixinWorldServer) worldServerIn).getActiveConfig();
        labelOuterLoop: for (EnumCreatureType enumCreatureType : EnumCreatureType.values()) {
            int limit = 0;
            int tickRate = 0;
            if (enumCreatureType == EnumCreatureType.MONSTER) {
                limit = activeConfig.getConfig().getSpawner().getMonsterSpawnLimit();
                tickRate = activeConfig.getConfig().getSpawner().getMonsterTickRate();
            } else if (enumCreatureType == EnumCreatureType.CREATURE) {
                limit = activeConfig.getConfig().getSpawner().getAnimalSpawnLimit();
                tickRate = activeConfig.getConfig().getSpawner().getAnimalTickRate();
            } else if (enumCreatureType == EnumCreatureType.WATER_CREATURE) {
                limit = activeConfig.getConfig().getSpawner().getAquaticSpawnLimit();
                tickRate = activeConfig.getConfig().getSpawner().getAquaticTickRate();
            } else if (enumCreatureType == EnumCreatureType.AMBIENT) {
                limit = activeConfig.getConfig().getSpawner().getAmbientSpawnLimit();
                tickRate = activeConfig.getConfig().getSpawner().getAmbientTickRate();
            }
            if (limit == 0 || tickRate == 0 || (worldTotalTime % tickRate) != 0L) {
                continue;
            }
            if ((!enumCreatureType.getPeacefulCreature() || spawnPeacefulMobs) && (enumCreatureType.getPeacefulCreature() || spawnHostileMobs)) {
                int entityCount = SpongeImplHooks.countEntities(worldServerIn, enumCreatureType, true);
                int maxCount = limit * chunkSpawnCandidates / MOB_SPAWN_COUNT_DIV;
                if (entityCount > maxCount) {
                    continue labelOuterLoop;
                }
                chunkIterator = this.eligibleSpawnChunks.iterator();
                int mobLimit = maxCount - entityCount + 1;
                labelChunkStart: while (chunkIterator.hasNext() && mobLimit > 0) {
                    final Chunk chunk = chunkIterator.next();
                    final BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
                    final BlockPos blockpos = getRandomChunkPosition(worldServerIn, chunk);
                    int k1 = blockpos.getX();
                    int l1 = blockpos.getY();
                    int i2 = blockpos.getZ();
                    IBlockState iblockstate = worldServerIn.getBlockState(blockpos);
                    if (!iblockstate.isNormalCube()) {
                        int spawnCount = 0;
                        for (int spawnLimit = 0; spawnLimit < 3; ++spawnLimit) {
                            int l2 = k1;
                            int i3 = l1;
                            int j3 = i2;
                            Biome.SpawnListEntry spawnListEntry = null;
                            IEntityLivingData ientitylivingdata = null;
                            int l3 = MathHelper.ceil(Math.random() * 4.0D);
                            for (int i4 = 0; i4 < l3; ++i4) {
                                l2 += worldServerIn.rand.nextInt(6) - worldServerIn.rand.nextInt(6);
                                i3 += worldServerIn.rand.nextInt(1) - worldServerIn.rand.nextInt(1);
                                j3 += worldServerIn.rand.nextInt(6) - worldServerIn.rand.nextInt(6);
                                mutableBlockPos.setPos(l2, i3, j3);
                                final double spawnX = l2 + 0.5F;
                                final double spawnY = i3;
                                final double spawnZ = j3 + 0.5F;
                                if (!worldServerIn.isAnyPlayerWithinRangeAt(spawnX, spawnY, spawnZ, 24.0D) && worldServerIn.getSpawnPoint().distanceSq(spawnX, spawnY, spawnZ) >= 576.0D) {
                                    if (spawnListEntry == null) {
                                        spawnListEntry = worldServerIn.getSpawnListEntryForTypeAt(enumCreatureType, mutableBlockPos);
                                        if (spawnListEntry == null) {
                                            break;
                                        }
                                    }
                                    final EntityType entityType = EntityTypeRegistryModule.getInstance().getForClass(spawnListEntry.entityClass);
                                    if (entityType != null) {
                                        Vector3d vector3d = new Vector3d(spawnX, spawnY, spawnZ);
                                        Transform<org.spongepowered.api.world.World> transform = new Transform<>((org.spongepowered.api.world.World) worldServerIn, vector3d);
                                        ConstructEntityEvent.Pre event = SpongeEventFactory.createConstructEntityEventPre(Sponge.getCauseStackManager().getCurrentCause(), entityType, transform);
                                        if (SpongeImpl.postEvent(event)) {
                                            continue;
                                        }
                                    }
                                    if (worldServerIn.canCreatureTypeSpawnHere(enumCreatureType, spawnListEntry, mutableBlockPos) && WorldEntitySpawner.canCreatureTypeSpawnAtLocation(EntitySpawnPlacementRegistry.getPlacementForEntity(spawnListEntry.entityClass), worldServerIn, mutableBlockPos)) {
                                        EntityLiving entityliving;
                                        try {
                                            entityliving = spawnListEntry.entityClass.getConstructor(new Class<?>[] { World.class }).newInstance(worldServerIn);
                                        } catch (Exception exception) {
                                            exception.printStackTrace();
                                            continue labelOuterLoop;
                                        }
                                        entityliving.setLocationAndAngles(spawnX, spawnY, spawnZ, worldServerIn.rand.nextFloat() * 360.0F, 0.0F);
                                        final boolean entityNotColliding = entityliving.isNotColliding();
                                        final SpawnerSpawnType type = SpongeImplHooks.canEntitySpawnHere(entityliving, entityNotColliding);
                                        if (type != SpawnerSpawnType.NONE) {
                                            if (type == SpawnerSpawnType.NORMAL) {
                                                ientitylivingdata = entityliving.onInitialSpawn(worldServerIn.getDifficultyForLocation(new BlockPos(entityliving)), ientitylivingdata);
                                            }
                                            if (entityNotColliding) {
                                                ++spawnCount;
                                                worldServerIn.spawnEntity(entityliving);
                                            } else {
                                                entityliving.setDead();
                                            }
                                            mobLimit--;
                                            if (mobLimit <= 0 || spawnCount >= SpongeImplHooks.getMaxSpawnPackSize(entityliving)) {
                                                continue labelChunkStart;
                                            }
                                        }
                                        totalSpawned += spawnCount;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        spongeWorld.getTimingsHandler().mobSpawn.stopTiming();
        return totalSpawned;
    }
}
Also used : EntityLiving(net.minecraft.entity.EntityLiving) World(net.minecraft.world.World) Biome(net.minecraft.world.biome.Biome) SpawnerSpawnType(org.spongepowered.common.util.SpawnerSpawnType) ChunkPos(net.minecraft.util.math.ChunkPos) BlockPos(net.minecraft.util.math.BlockPos) IMixinEntityPlayer(org.spongepowered.common.interfaces.entity.player.IMixinEntityPlayer) IBlockState(net.minecraft.block.state.IBlockState) IMixinChunk(org.spongepowered.common.interfaces.IMixinChunk) EnumCreatureType(net.minecraft.entity.EnumCreatureType) IEntityLivingData(net.minecraft.entity.IEntityLivingData) IMixinWorldServer(org.spongepowered.common.interfaces.world.IMixinWorldServer) PlayerChunkMapEntry(net.minecraft.server.management.PlayerChunkMapEntry) IMixinChunk(org.spongepowered.common.interfaces.IMixinChunk) Chunk(net.minecraft.world.chunk.Chunk) IMixinChunkProviderServer(org.spongepowered.common.interfaces.world.gen.IMixinChunkProviderServer) EntityType(org.spongepowered.api.entity.EntityType) ConstructEntityEvent(org.spongepowered.api.event.entity.ConstructEntityEvent) Vector3d(com.flowpowered.math.vector.Vector3d) IMixinEntityPlayer(org.spongepowered.common.interfaces.entity.player.IMixinEntityPlayer) EntityPlayer(net.minecraft.entity.player.EntityPlayer) Transform(org.spongepowered.api.entity.Transform) Overwrite(org.spongepowered.asm.mixin.Overwrite)

Example 59 with IMixinWorldServer

use of org.spongepowered.common.interfaces.world.IMixinWorldServer in project SpongeForge by SpongePowered.

the class MixinBlockLeaves method onBreakBlock.

@Redirect(method = "breakBlock", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;beginLeavesDecay(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)V", remap = false))
public void onBreakBlock(Block block, IBlockState state, net.minecraft.world.World worldIn, BlockPos pos) {
    if (!worldIn.isRemote) {
        final PhaseTracker phaseTracker = PhaseTracker.getInstance();
        final IPhaseState currentState = phaseTracker.getCurrentState();
        final boolean isBlockAlready = currentState.getPhase() != TrackingPhases.BLOCK;
        @Nullable PhaseContext<?> blockDecay = null;
        final boolean isWorldGen = currentState.isWorldGeneration();
        if (isBlockAlready && !isWorldGen) {
            final LocatableBlock locatable = LocatableBlock.builder().location(new Location<World>((World) worldIn, pos.getX(), pos.getY(), pos.getZ())).state((BlockState) state).build();
            blockDecay = BlockPhase.State.BLOCK_DECAY.createPhaseContext().source(locatable);
        }
        try (CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame();
            PhaseContext<?> context = blockDecay != null ? blockDecay.buildAndSwitch() : null) {
            frame.addContext(EventContextKeys.LEAVES_DECAY, (World) worldIn);
            if (SpongeCommonEventFactory.callChangeBlockEventPre((IMixinWorldServer) worldIn, pos).isCancelled()) {
                return;
            }
            block.beginLeavesDecay(state, worldIn, pos);
        }
    } else {
        block.beginLeavesDecay(state, worldIn, pos);
    }
}
Also used : PhaseTracker(org.spongepowered.common.event.tracking.PhaseTracker) BlockState(org.spongepowered.api.block.BlockState) IBlockState(net.minecraft.block.state.IBlockState) CauseStackManager(org.spongepowered.api.event.CauseStackManager) IPhaseState(org.spongepowered.common.event.tracking.IPhaseState) LocatableBlock(org.spongepowered.api.world.LocatableBlock) IMixinWorldServer(org.spongepowered.common.interfaces.world.IMixinWorldServer) World(org.spongepowered.api.world.World) Nullable(javax.annotation.Nullable) Redirect(org.spongepowered.asm.mixin.injection.Redirect)

Example 60 with IMixinWorldServer

use of org.spongepowered.common.interfaces.world.IMixinWorldServer in project SpongeForge by SpongePowered.

the class MixinBlockLog method onBreakBlock.

@Redirect(method = "breakBlock", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;beginLeavesDecay(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)V", remap = false))
public void onBreakBlock(Block block, IBlockState state, net.minecraft.world.World worldIn, BlockPos pos) {
    if (!worldIn.isRemote) {
        if (SpongeCommonEventFactory.callChangeBlockEventPre((IMixinWorldServer) worldIn, pos).isCancelled()) {
            return;
        }
        final PhaseTracker phaseTracker = PhaseTracker.getInstance();
        final IPhaseState currentState = phaseTracker.getCurrentState();
        final boolean isBlockAlready = currentState.getPhase() != TrackingPhases.BLOCK;
        final boolean isWorldGen = currentState.isWorldGeneration();
        if (isBlockAlready && !isWorldGen) {
            final LocatableBlock locatable = LocatableBlock.builder().location(new Location<World>((World) worldIn, pos.getX(), pos.getY(), pos.getZ())).state((BlockState) state).build();
            BlockPhase.State.BLOCK_DECAY.createPhaseContext().source(locatable).buildAndSwitch();
        }
        block.beginLeavesDecay(state, worldIn, pos);
        if (isBlockAlready && !isWorldGen) {
            phaseTracker.completePhase(BlockPhase.State.BLOCK_DECAY);
        }
    } else {
        block.beginLeavesDecay(state, worldIn, pos);
    }
}
Also used : PhaseTracker(org.spongepowered.common.event.tracking.PhaseTracker) BlockState(org.spongepowered.api.block.BlockState) IBlockState(net.minecraft.block.state.IBlockState) IPhaseState(org.spongepowered.common.event.tracking.IPhaseState) IMixinWorldServer(org.spongepowered.common.interfaces.world.IMixinWorldServer) LocatableBlock(org.spongepowered.api.world.LocatableBlock) World(org.spongepowered.api.world.World) Redirect(org.spongepowered.asm.mixin.injection.Redirect)

Aggregations

IMixinWorldServer (org.spongepowered.common.interfaces.world.IMixinWorldServer)61 WorldServer (net.minecraft.world.WorldServer)25 BlockPos (net.minecraft.util.math.BlockPos)19 ArrayList (java.util.ArrayList)17 Entity (org.spongepowered.api.entity.Entity)15 World (org.spongepowered.api.world.World)15 IBlockState (net.minecraft.block.state.IBlockState)13 SpawnEntityEvent (org.spongepowered.api.event.entity.SpawnEntityEvent)13 CauseStackManager (org.spongepowered.api.event.CauseStackManager)11 Overwrite (org.spongepowered.asm.mixin.Overwrite)11 BlockSnapshot (org.spongepowered.api.block.BlockSnapshot)9 IMixinEntity (org.spongepowered.common.interfaces.entity.IMixinEntity)9 EntityItem (net.minecraft.entity.item.EntityItem)8 User (org.spongepowered.api.entity.living.player.User)8 LocatableBlock (org.spongepowered.api.world.LocatableBlock)8 PhaseTracker (org.spongepowered.common.event.tracking.PhaseTracker)7 Entity (net.minecraft.entity.Entity)6 EntityPlayer (net.minecraft.entity.player.EntityPlayer)6 Chunk (net.minecraft.world.chunk.Chunk)6 IMixinChunk (org.spongepowered.common.interfaces.IMixinChunk)6