-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/carpetfixes/mixins/entityFixes/FishingBobberEntity_outsideWaterMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package carpetfixes.mixins.entityFixes; | ||
|
||
import carpetfixes.CarpetFixesSettings; | ||
import net.minecraft.entity.projectile.FishingBobberEntity; | ||
import net.minecraft.fluid.Fluid; | ||
import net.minecraft.fluid.FluidState; | ||
import net.minecraft.tag.FluidTags; | ||
import net.minecraft.tag.Tag; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(FishingBobberEntity.class) | ||
public abstract class FishingBobberEntity_outsideWaterMixin { | ||
@Shadow private boolean inOpenWater; | ||
@Shadow private FishingBobberEntity.State state; | ||
@Shadow private int hookCountdown; | ||
|
||
@Redirect(method= "tick()V",at=@At(value="INVOKE",target="Lnet/minecraft/fluid/FluidState;isIn(Lnet/minecraft/tag/Tag;)Z")) | ||
private boolean betterTick(FluidState fluidState, Tag<Fluid> tag) { | ||
boolean state = fluidState.isIn(FluidTags.WATER); | ||
if (CarpetFixesSettings.fishingOutsideWaterFix && !state) { | ||
this.state = FishingBobberEntity.State.FLYING; | ||
this.inOpenWater = false; | ||
this.hookCountdown = 0; | ||
} | ||
return state; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
accessWidener v1 named | ||
extendable class net/minecraft/entity/projectile/FishingBobberEntity$State |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters