Adds the hit effects into the world for the specified {@link IBlockState}.

@param world the world
@param target the target
@param particleManager the effect renderer
@param states the states
179346
@SideOnly(Side.CLIENT)
	public static void addHitEffects(World world, RayTraceResult target, ParticleManager particleManager, IBlockState... states)
	{
		BlockPos pos = target.getBlockPos();
		if (ArrayUtils.isEmpty(states))
			states = new IBlockState[] { world.getBlockState(pos) };

		IBlockState baseState = world.getBlockState(pos);
		if (baseState.getRenderType() != EnumBlockRenderType.INVISIBLE)
			return;

		double fxX = pos.getX() + world.rand.nextDouble();
		double fxY = pos.getY() + world.rand.nextDouble();
		double fxZ = pos.getZ() + world.rand.nextDouble();

		AxisAlignedBB aabb = baseState.getBoundingBox(world, pos);
		switch (target.sideHit)
		{
			case DOWN:
				fxY = pos.getY() + aabb.minY - 0.1F;
				break;
			case UP:
				fxY = pos.getY() + aabb.maxY + 0.1F;
				break;
			case NORTH:
				fxZ = pos.getZ() + aabb.minZ - 0.1F;
				break;
			case SOUTH:
				fxZ = pos.getZ() + aabb.maxY + 0.1F;
				break;
			case EAST:
				fxX = pos.getX() + aabb.maxX + 0.1F;
				break;
			case WEST:
				fxX = pos.getX() + aabb.minX + 0.1F;
				break;
			default:
				break;
		}

		int id = Block.getStateId(states[world.rand.nextInt(states.length)]);

		ParticleDigging.Factory factory = new ParticleDigging.Factory();
		ParticleDigging fx = (ParticleDigging) factory.createParticle(0, world, fxX, fxY, fxZ, 0, 0, 0, id);
		fx.multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F);
		particleManager.addEffect(fx);
	}
670846
void addState(State<S, L> state) {
        ElementReference ref = states.referencedAdd(state);
        state.setBlockReference(ref);
        state.setBlock(this);
    }
966322
@Override
    public void setTarget(String target) {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
            SibTr.debug(this, TRACE, "setTarget", target);
        }
        _target = target;

    }
1170395
@Override
  public void initState(State state) {
    this.state = state;
    // initalize internal windowing state
    super.initState(this.state);
    // initialize user defined state
    if (!this.state.containsKey(USER_STATE)) {
      this.state.put(USER_STATE, new HashMapState<K, V>());
    }
    this.statefulWindowedBolt.initState((State<K, V>) this.state.get(USER_STATE));
  }
405204
public static <T> void restoreInstanceState(@NonNull T target, @Nullable Bundle state) {
        IMPL.restoreInstanceState(target, state);
    }
1352461
@SubscribeEvent
    public void postRender(RenderWorldLastEvent event)
    {
        // Check that the video producer and frame type match - eg if this is a colourmap frame, then
        // only the colourmap videoproducer needs to do anything.
        boolean colourmapFrame = TextureHelper.colourmapFrame;
        boolean colourmapVideoProducer = this.videoProducer.getVideoType() == VideoType.COLOUR_MAP;
        if (colourmapFrame != colourmapVideoProducer)
            return;

        EntityPlayerSP player = Minecraft.getMinecraft().player;
        float x = (float) (player.lastTickPosX + (player.posX - player.lastTickPosX) * event.getPartialTicks());
        float y = (float) (player.lastTickPosY + (player.posY - player.lastTickPosY) * event.getPartialTicks());
        float z = (float) (player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * event.getPartialTicks());
        float yaw = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * event.getPartialTicks();
        float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.getPartialTicks();

        long time_before_ns = System.nanoTime();

        if (observer != null)
            observer.frameProduced();

        if (time_before_ns < retry_time_ns)
            return;

        boolean success = false;

        long time_after_render_ns;

        try
        {
            int size = this.videoProducer.getRequiredBufferSize();

            if (AddressHelper.getMissionControlPort() == 0) {
                success = true;

                if (envServer != null) {
                    // Write the obs data into a newly allocated buffer:
                    byte[] data = new byte[size];
                    this.buffer.clear();
                    this.videoProducer.getFrame(this.missionInit, this.buffer);
                    this.buffer.get(data); // Avoiding copy not simple as data is kept & written to a stream later.
                    time_after_render_ns = System.nanoTime();

                    envServer.addFrame(data);
                } else {
                    time_after_render_ns = System.nanoTime();
                }
            } else {
                // Get buffer ready for writing to:
                this.buffer.clear();
                this.headerbuffer.clear();
                // Write the pos data:
                this.headerbuffer.putFloat(x);
                this.headerbuffer.putFloat(y);
                this.headerbuffer.putFloat(z);
                this.headerbuffer.putFloat(yaw);
                this.headerbuffer.putFloat(pitch);
                // Write the frame data:
                this.videoProducer.getFrame(this.missionInit, this.buffer);
                // The buffer gets flipped by getFrame(), but we need to flip our header buffer ourselves:
                this.headerbuffer.flip();
                ByteBuffer[] buffers = {this.headerbuffer, this.buffer};
                time_after_render_ns = System.nanoTime();

                success = this.connection.sendTCPBytes(buffers, size + POS_HEADER_SIZE);
            }

            long time_after_ns = System.nanoTime();
            float ms_send = (time_after_ns - time_after_render_ns) / 1000000.0f;
            float ms_render = (time_after_render_ns - time_before_ns) / 1000000.0f;
            if (success)
            {
                this.failedTCPSendCount = 0;    // Reset count of failed sends.
                this.timeOfLastFrame = System.currentTimeMillis();
                if (this.timeOfFirstFrame == 0)
                	this.timeOfFirstFrame = this.timeOfLastFrame;
                this.framesSent++;
	            //            System.out.format("Total: %.2fms; collecting took %.2fms; sending %d bytes took %.2fms\n", ms_send + ms_render, ms_render, size, ms_send);
	            //            System.out.println("Collect: " + ms_render + "; Send: " + ms_send);
            }
        }
        catch (Exception e)
        {
            System.out.format(e.getMessage());
        }
        
        if (!success) {
            System.out.format("Failed to send frame - will retry in %d seconds\n", RETRY_GAP_NS / 1000000000L);
            retry_time_ns = time_before_ns + RETRY_GAP_NS;
            this.failedTCPSendCount++;
        }
    }
1156297
void setState(final WorldState state) {
		if (this.ready) {
			throw new IllegalStateException(
					"Cannot reassign the world state of a response.");
		}
		this.state = state;
		this.ready = true;
		// Notify any blocking/waiting threads
		synchronized (this) {
			this.notifyAll();
		}
	}
527277
public static AxisAlignedBB[] getCollisionBoundingBoxes(World world, MBlockState state)
	{
		return getCollisionBoundingBoxes(world, state, false);
	}
314639
public void targetAppears( TargetHandler targetItf ) {
		this.defaultTargetHandlerResolver.addTargetHandler( targetItf );

		// When a target is deployed, we may also have to update instance states.
		// Consider as an example when the DM restarts. Targets may be injected
		// before and after the pojo was started by iPojo.

		// See #519 for more details.
		// Notice we restore instances only when the DM was started (the messaging
		// must be ready). If it is not started, do nothing. The "start" method
		// will trigger the restoration.

		// We consider the DM is started if the timer is not null.
		if( this.timer != null )
			restoreInstancesFrom( targetItf );
	}
698494
private void pushState(int indentation) {
        states.push(state);
        state = new StreamStatus();
        state.setIndentationLevel(indentation);
    }
956066
public void replaceBlocks(World world, MBlockState state)
	{
		AxisAlignedBB[] aabbs = AABBUtils.getCollisionBoundingBoxes(world, state, true);
		for (AxisAlignedBB aabb : aabbs)
		{
			if (aabb == null)
				continue;

			for (BlockPos pos : BlockPosUtils.getAllInBox(aabb))
			{
				if (world.getBlockState(pos).getBlock().isReplaceable(world, pos))
					world.setBlockToAir(pos);
			}
		}
	}
1021751
public void initialize(final S state) {
        final FastMealyState<O> init = this.observationTree.addInitialState();
        this.nodeToObservationMap.put(state, init);
    }
269628
public void cloneActionState(final ActionState source, final ActionState target) {
        source.getActionList().forEach(a -> target.getActionList().add(a));
        source.getExitActionList().forEach(a -> target.getExitActionList().add(a));
        source.getAttributes().asMap().forEach((k, v) -> target.getAttributes().put(k, v));
        source.getTransitionSet().forEach(t -> target.getTransitionSet().addAll(t));
        val field = ReflectionUtils.findField(target.getExceptionHandlerSet().getClass(), "exceptionHandlers");
        ReflectionUtils.makeAccessible(field);
        val list = (List<FlowExecutionExceptionHandler>) ReflectionUtils.getField(field, target.getExceptionHandlerSet());
        list.forEach(h -> source.getExceptionHandlerSet().add(h));
        target.setDescription(source.getDescription());
        target.setCaption(source.getCaption());
    }
125214
void addToSubBlock(State<S, L> state) {
        if (currSubBlock == null) {
            throw new IllegalStateException("No current sub block");
        }
        currSubBlock.referencedAdd(state);
        elementsInSubBlocks++;
    }
1363403
void copyTo(KeyState target) {
        keysPressed.copyTo(target.keysPressed);
        target.window = window;
        target.modifiers = modifiers;
    }
183549
public void addEmitter(ParticleEmitter emitter) {
		emitters.add(emitter);
		
		ParticlePool pool= new ParticlePool( this, maxParticlesPerEmitter );
		particlesByEmitter.put( emitter, pool );
	}
428798
public void processIntermediateMatches(List targets, Object result)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "processIntermediateMatches",
        "targets: " + targets + ";results: " + result);

    //((List) result).addAll(targets);
    if (result != null)
       ((TopicAclTraversalResults) result).consolidate(targets);    
       
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "processIntermediateMatches");

  }