IndyPets - Independent Pets (Fabric)

IndyPets - Independent Pets (Fabric)

128k Downloads

Pet Zones

BeeFox-sys opened this issue ยท 4 comments

commented

Pets will only wander in a radius, to prevent them permanently wandering away and getting lost. Server Config Option

commented

They already do that.
Do you just need a config option? For the radius?

commented

oh! i didn't realize! yeah a config for the radius would be nice or more information on that (unless i just can't read)

commented

I put a description in the patch notes and forgot to add it to the main page. Will do that once this change is out.

Right now, the radius is between 80-128 blocks (5-8 chunks), with a higher chance to head home the further away the pet is:

// distance to home
float d = (float) Math.sqrt(tameable.getBlockPos().getSquaredDistance(follower.getHomePos()));
float start = Commands.WHISTLE_RADIUS - 16;
float end = Commands.WHISTLE_RADIUS + 32;
// probability to head home, starts at 0 and grows to 1 over the interval from start to end
float p;
if (d <= start) p = 0;
else if (d >= end) p = 1;
else p = (d - start) / (end - start);

I'm not quite sure how exactly the config should look like because it's actually 2 radii.
Maybe just innerHomeRadius and outerHomeRadius?
Issue is that outer always needs to be larger than inner so I'd have to do some config UI shennanigans.
Maybe have homeRadius and a "border", so it goes from homeRadius to homeRadius+border?
Though that might not be as intuitive...?

Gonna think about that a bit, probably won't get anything done today.

Ah and just so you know, IndyPets doesn't really have server settings.
If a client has the mod installed, it'll always use the client settings (the client sends its config to the server).
While the server does have its own config, it only sets the default values for "vanilla" players (players without IndyPets).

commented

Aight, added a setting for the outer radius + a percentage for the inner radius, which you basically never have to change.
Decreased the radius from 128 to 80, so whistling should always reach the pets too!
Also updated the mod description to mention the "homes".