net.minecraft.entity.projectile.FishingBobberEntity Java Examples

The following examples show how to use net.minecraft.entity.projectile.FishingBobberEntity. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AutoFishHack.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onReceivedPacket(PacketInputEvent event)
{
	ClientPlayerEntity player = MC.player;
	if(player == null || player.fishHook == null)
		return;
	
	if(!(event.getPacket() instanceof PlaySoundS2CPacket))
		return;
	
	// check sound type
	PlaySoundS2CPacket sound = (PlaySoundS2CPacket)event.getPacket();
	if(!SoundEvents.ENTITY_FISHING_BOBBER_SPLASH.equals(sound.getSound()))
		return;
	
	if(debugDraw.isChecked())
		lastSoundPos = new Vec3d(sound.getX(), sound.getY(), sound.getZ());
	
	// check position
	FishingBobberEntity bobber = player.fishHook;
	if(Math.abs(sound.getX() - bobber.getX()) > validRange.getValue()
		|| Math.abs(sound.getZ() - bobber.getZ()) > validRange.getValue())
		return;
	
	// catch fish
	rightClick();
	castRodTimer = 15;
}
 
Example #2
Source File: AutoFishHack.java    From Wurst7 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onRender(float partialTicks)
{
	if(!debugDraw.isChecked())
		return;
	
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_LIGHTING);
	
	GL11.glPushMatrix();
	RenderUtils.applyRenderOffset();
	
	FishingBobberEntity bobber = MC.player.fishHook;
	if(bobber != null)
	{
		GL11.glPushMatrix();
		GL11.glTranslated(bobber.getX(), bobber.getY(), bobber.getZ());
		GL11.glCallList(box);
		GL11.glPopMatrix();
	}
	
	if(lastSoundPos != null)
	{
		GL11.glPushMatrix();
		GL11.glTranslated(lastSoundPos.x, lastSoundPos.y, lastSoundPos.z);
		GL11.glCallList(cross);
		GL11.glPopMatrix();
	}
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}