Skip to content

Commit

Permalink
foxfix
Browse files Browse the repository at this point in the history
  • Loading branch information
afamiliarquiet committed Nov 20, 2024
1 parent 0d29f80 commit d36a8fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod_name=Familiar Magic
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=MIT
# The mod version. See https://semver.org/
mod_version=1.0.5
mod_version=1.0.6
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public SummoningTableBlockEntity(BlockPos pos, BlockState blockState) {
Arrays.fill(this.targetFromCandlesInNybbles, FamiliarTricks.NO_CANDLE);
}

// could maybe remember these for a few ticks if performance is a concern, update when candles update or something
public boolean hasLitCandles() {
for (byte tasty : this.targetFromCandlesInNybbles) {
if ((tasty & (FamiliarTricks.NO_CANDLE | FamiliarTricks.UNLIT_CANDLE)) != 0) {
Expand All @@ -154,8 +155,9 @@ public boolean hasLitCandles() {
return true;
}

public boolean hasTarget() {
public boolean hasTarget() {
return this.level instanceof ServerLevel serverLevel
&& hasLitCandles()
&& findTargetByUuid(this.getCandleTarget(), serverLevel.getServer()) != null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ protected FamiliarFoxMixin(EntityType<? extends Animal> entityType, Level level)
@Inject(at = @At("TAIL"), method = "registerGoals")
private void registerGoals(CallbackInfo ci) {
// a slightly more relieving casting than (Fox)(Object).. i'm kinda glad this fest is on neo, i'm liking it here
this.goalSelector.addGoal(10, new FoxActivateSummoningTableGoal((Fox)this.self(), 1, 12));
this.goalSelector.addGoal(6, new FoxActivateSummoningTableGoal((Fox)this.self(), 1, 12));
}
}

0 comments on commit d36a8fe

Please sign in to comment.