Skip to content

Commit 805b8d0

Browse files
committed
fix: Fix compile error
1 parent 8d115bd commit 805b8d0

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

common/src/main/java/net/blay09/mods/littlejoys/handler/FishingSpotHandler.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public static Optional<BlockPos> findFishingSpot(ServerLevel serverLevel, BlockP
135135
return poiManager.findClosest(it -> it.is(ModPoiTypeTags.FISHING_SPOTS), pos, range, PoiManager.Occupancy.ANY);
136136
}
137137

138-
public static int claimFishingSpot(FishingHook fishingHook, ServerLevel level, BlockPos pos) {
138+
public static int claimFishingSpot(ServerLevel level, BlockPos pos) {
139139
level.sendParticles(ModParticles.goldRush,
140140
pos.getX() + 0.5f,
141141
pos.getY() + 0.5f,
@@ -152,13 +152,12 @@ public static int claimFishingSpot(FishingHook fishingHook, ServerLevel level, B
152152
return Math.round(LittleJoysConfig.getActive().fishingSpots.secondsUntilLured * 20);
153153
}
154154

155-
public static void consumeFishingSpot(FishingHook fishingHook, ServerLevel level, BlockPos pos) {
155+
public static void consumeFishingSpot(@Nullable Player player, ServerLevel level, BlockPos pos) {
156156
final var x = pos.getX() + 0.5f;
157157
final var y = pos.getY() + 0.5f;
158158
final var z = pos.getZ() + 0.5f;
159159
level.sendParticles(ParticleTypes.CLOUD, x, y, z, 8, 0.25f, 0.25f, 0.25f, 0f);
160160
level.destroyBlock(pos, false);
161-
final var player = fishingHook.getPlayerOwner();
162161
if (player != null) {
163162
player.awardStat(ModStats.fishingSpotsFished);
164163

common/src/main/java/net/blay09/mods/littlejoys/mixin/FishingHookMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private void catchingFish(BlockPos pos, CallbackInfo ci) {
4242
&& timeUntilLured > 40) {
4343
FishingSpotHandler.findFishingSpot(serverLevel, pos).ifPresent(fishingSpotPos -> {
4444
littlejoys_fishingSpot = fishingSpotPos;
45-
int configuredTimeUntilLured = FishingSpotHandler.claimFishingSpot((FishingHook) (Object) this, serverLevel, fishingSpotPos);
45+
int configuredTimeUntilLured = FishingSpotHandler.claimFishingSpot(serverLevel, fishingSpotPos);
4646
if (configuredTimeUntilLured >= 0) {
4747
timeUntilLured = Math.max(1, configuredTimeUntilLured);
4848
}
@@ -54,7 +54,7 @@ private void catchingFish(BlockPos pos, CallbackInfo ci) {
5454
private void retrieve(ItemStack itemStack, CallbackInfoReturnable<Integer> ci) {
5555
if (level() instanceof ServerLevel serverLevel) {
5656
if (littlejoys_fishingSpot != null && nibble > 0) {
57-
FishingSpotHandler.consumeFishingSpot(((FishingHook) (Object) this), serverLevel, littlejoys_fishingSpot);
57+
FishingSpotHandler.consumeFishingSpot(((FishingHook) (Object) this).getPlayerOwner(), serverLevel, littlejoys_fishingSpot);
5858
}
5959
}
6060
}

neoforge/src/main/java/net/blay09/mods/littlejoys/neoforge/mixin/AquaFishingBobberEntityMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private void catchingFish(BlockPos pos, CallbackInfo ci) {
3131
if (fishingSpotHolder.getFishingSpot().isEmpty() && fishingHookAccessor.getTimeUntilLured() > 40) {
3232
FishingSpotHandler.findFishingSpot(serverLevel, pos).ifPresent(fishingSpotPos -> {
3333
fishingSpotHolder.setFishingSpot(fishingSpotPos);
34-
int configuredTimeUntilLured = FishingSpotHandler.claimFishingSpot(this, serverLevel, fishingSpotPos);
34+
int configuredTimeUntilLured = FishingSpotHandler.claimFishingSpot(serverLevel, fishingSpotPos);
3535
if (configuredTimeUntilLured >= 0) {
3636
fishingHookAccessor.setTimeUntilLured(Math.max(1, configuredTimeUntilLured));
3737
}
@@ -51,7 +51,7 @@ private void retrieve(ItemStack itemStack, CallbackInfoReturnable<Integer> ci) {
5151
final var fishingSpotHolder = (FishingSpotHolder) this;
5252
final var fishingSpot = fishingSpotHolder.getFishingSpot();
5353
if (fishingSpot.isPresent() && fishingHookAccessor.getNibble() > 0) {
54-
FishingSpotHandler.consumeFishingSpot(this, serverLevel, fishingSpot.get());
54+
FishingSpotHandler.consumeFishingSpot(getPlayerOwner(), serverLevel, fishingSpot.get());
5555
}
5656
}
5757
} catch (Throwable e) {

0 commit comments

Comments
 (0)