neoLegacy/Minecraft.World/FishingHook.h
BrainFart17 e17e26ff99 Fix bugs and improve fishing mechanics parity with TU 31
- Based fishing mechanics off of decompiled java 1.7.2 instead of 1.12.
- Added check for sky access
- Switching between different fishing rods now reels the line back in
- Fixed duplicate assignment in fishingTreasuresArray
- Remove testing weights from catchTypeArray
- Make lureLevel and luckLevel member variables of FishingHook that are calculated upon initialization instead of recalculating every tick.
- Changed random nibbleTimer range from 5 - 30 secs to 5 - 45 secs
- Fixed out of order and incorrect assignments of fishingJunkArray
- Values are now clamped to prevent unintended behavior
- Lure now affects loot rates.
2026-04-07 08:00:13 -07:00

71 lines
1.4 KiB
C++

#pragma once
using namespace std;
#include "Entity.h"
#include "../Minecraft.World/ItemInstance.h"
class Player;
class FishingHook : public Entity
{
public:
eINSTANCEOF GetType() { return eTYPE_FISHINGHOOK; }
private:
int xTile;
int yTile;
int zTile;
int lastTile;
bool inGround;
public:
int shakeTime;
shared_ptr<Player> owner;
private:
int life;
int flightTime;
int nibble;
int nibbleTimer;
int lureTime;
int lureLevel;
int luckLevel;
shared_ptr<ItemInstance> previousItem;
public:
shared_ptr<Entity> hookedIn;
private:
void _init();
public:
FishingHook(Level *level);
FishingHook(Level *level, double x, double y, double z, shared_ptr<Player> owner);
FishingHook(Level *level, shared_ptr<Player> mob);
protected:
virtual void defineSynchedData();
public:
bool shouldRenderAtSqrDistance(double distance);
void shoot(double xd, double yd, double zd, float pow, float uncertainty);
private:
int lSteps;
double lx, ly, lz, lyr, lxr;
double lxd, lyd, lzd;
public:
virtual void lerpTo(double x, double y, double z, float yRot, float xRot, int steps);
virtual void lerpMotion(double xd, double yd, double zd);
virtual void tick();
virtual void addAdditonalSaveData(CompoundTag *tag);
virtual void readAdditionalSaveData(CompoundTag *tag);
virtual float getShadowHeightOffs();
virtual void getEnchantLevels();
int retrieve();
// 4J Stu - Brought forward from 1.4
virtual void remove();
};