-
Notifications
You must be signed in to change notification settings - Fork 5
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
12 changed files
with
92 additions
and
44 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
- added compatibility with Aquaculture 2 for fishing related features (reported by @JinKhya, @Ladocterus) | ||
- added compatibility with MC Dungeons Weapons for damage related features (reported by @mochalit) | ||
- fixed crash `Accessing LegacyRandomSource from multiple threads` (reported by @Luigi delle Bicocche, @davey) | ||
- fixed compatibility crash `java.lang.IndexOutOfBoundsException` (reported by @GermanArtur, @memphismc) | ||
- fixed long game loading time when GitHub cannot be accessed without proxy (reported by @SettingDust) | ||
- added missing compatibility for Aquaculture 2 (reported by @LilChromie) | ||
- added Aquaculture 2 compatibility for NeoForge (reported by @LilChromie) | ||
- fixed random server crash `Accessing LegacyRandomSource from multiple threads` (reported by @AVeryLittleGhost, @memphismc) |
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
29 changes: 29 additions & 0 deletions
29
forge/src/main/java/com/majruszlibrary/mixin/forge/MixinAquaFishingBobberEntity.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,29 @@ | ||
package com.majruszlibrary.mixin.forge; | ||
|
||
import com.majruszlibrary.events.OnFishingTimeGet; | ||
import com.majruszlibrary.events.base.Events; | ||
import com.majruszlibrary.mixin.MixinFishingHook; | ||
import com.teammetallurgy.aquaculture.entity.AquaFishingBobberEntity; | ||
import org.spongepowered.asm.mixin.Dynamic; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Pseudo | ||
@Mixin( targets = "com.teammetallurgy.aquaculture.entity.AquaFishingBobberEntity" ) | ||
public abstract class MixinAquaFishingBobberEntity extends MixinFishingHook { | ||
@Dynamic( "Aquaculture 2 compatibility" ) | ||
@Redirect( | ||
at = @At( | ||
opcode = 181, // putfield | ||
ordinal = 3, | ||
target = "Lcom/teammetallurgy/aquaculture/entity/AquaFishingBobberEntity;timeUntilLured:I", | ||
value = "FIELD" | ||
), | ||
method = "catchingFish (Lnet/minecraft/core/BlockPos;)V" | ||
) | ||
private void catchingFish( AquaFishingBobberEntity hook, int timeUntilLured ) { | ||
this.timeUntilLured = Events.dispatch( new OnFishingTimeGet( hook, timeUntilLured ) ).getTicks(); | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
neoforge/src/main/java/com/majruszlibrary/events/OnItemFishedNeoForge.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,17 @@ | ||
package com.majruszlibrary.events; | ||
|
||
import com.majruszlibrary.events.base.Events; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraftforge.event.entity.player.ItemFishedEvent; | ||
import net.minecraftforge.eventbus.api.SubscribeEvent; | ||
import net.minecraftforge.fml.common.Mod; | ||
|
||
@Mod.EventBusSubscriber | ||
public class OnItemFishedNeoForge { | ||
@SubscribeEvent | ||
public static void onItemFished( ItemFishedEvent event ) { | ||
Player player = event.getEntity(); | ||
|
||
Events.dispatch( new OnItemFished( player, event.getHookEntity(), player.getItemInHand( player.getUsedItemHand() ), event.getDrops() ) ); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
neoforge/src/main/java/com/majruszlibrary/mixin/neoforge/MixinAquaFishingBobberEntity.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,29 @@ | ||
package com.majruszlibrary.mixin.neoforge; | ||
|
||
import com.majruszlibrary.events.OnFishingTimeGet; | ||
import com.majruszlibrary.events.base.Events; | ||
import com.majruszlibrary.mixin.MixinFishingHook; | ||
import com.teammetallurgy.aquaculture.entity.AquaFishingBobberEntity; | ||
import org.spongepowered.asm.mixin.Dynamic; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Pseudo | ||
@Mixin( targets = "com.teammetallurgy.aquaculture.entity.AquaFishingBobberEntity" ) | ||
public abstract class MixinAquaFishingBobberEntity extends MixinFishingHook { | ||
@Dynamic( "Aquaculture 2 compatibility" ) | ||
@Redirect( | ||
at = @At( | ||
opcode = 181, // putfield | ||
ordinal = 3, | ||
target = "Lcom/teammetallurgy/aquaculture/entity/AquaFishingBobberEntity;timeUntilLured:I", | ||
value = "FIELD" | ||
), | ||
method = "catchingFish (Lnet/minecraft/core/BlockPos;)V" | ||
) | ||
private void catchingFish( AquaFishingBobberEntity hook, int timeUntilLured ) { | ||
this.timeUntilLured = Events.dispatch( new OnFishingTimeGet( hook, timeUntilLured ) ).getTicks(); | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
neoforge/src/main/java/com/majruszlibrary/mixin/neoforge/MixinFishingHook.java
This file was deleted.
Oops, something went wrong.
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