Skip to content

Instantly share code, notes, and snippets.

@IQAndreas
Created February 14, 2013 15:48
Show Gist options
  • Save IQAndreas/4953662 to your computer and use it in GitHub Desktop.
Save IQAndreas/4953662 to your computer and use it in GitHub Desktop.
Partial from MineCraft decompiled source - `EntityFishHook::onUpdate()`
if (this.ticksCatchable > 0)
{
--this.ticksCatchable;
}
else
{
short var28 = 500;
if (this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) + 1, MathHelper.floor_double(this.posZ)))
{
var28 = 300;
}
if (this.rand.nextInt(var28) == 0)
{
this.ticksCatchable = this.rand.nextInt(30) + 10;
// ... Play splashing sounds and particles
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment