generated from babric/babric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[StAPI] Attempt at getting multiplayer to work
- Loading branch information
1 parent
ddee889
commit 86f2f50
Showing
6 changed files
with
76 additions
and
37 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
2 changes: 1 addition & 1 deletion
2
...iplayerClientInteractionManagerMixin.java → ...iplayerClientInteractionManagerMixin.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
2 changes: 1 addition & 1 deletion
2
.../SinglePlayerInteractionManagerMixin.java → .../SinglePlayerInteractionManagerMixin.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
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
42 changes: 42 additions & 0 deletions
42
...thanupdates/forge/mixin/server/server/player/nostation/ServerInteractionManagerMixin.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,42 @@ | ||
package io.github.betterthanupdates.forge.mixin.server.server.player.nostation; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
import io.github.betterthanupdates.forge.block.ForgeBlock; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.server.player.ServerInteractionManager; | ||
import net.minecraft.server.world.ServerWorld; | ||
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(ServerInteractionManager.class) | ||
public class ServerInteractionManagerMixin { | ||
@Shadow | ||
private ServerWorld world; | ||
|
||
@Shadow | ||
private int field_2318; | ||
|
||
@Shadow | ||
private int field_2319; | ||
|
||
@Shadow | ||
private int field_2320; | ||
|
||
@Redirect(method = "method_1828", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;getHardness(Lnet/minecraft/entity/player/PlayerEntity;)F")) | ||
private float forge$method_1828$blockStrength(Block instance, PlayerEntity playerEntity) { | ||
return ((ForgeBlock) instance).blockStrength(this.world, playerEntity, this.field_2318, this.field_2319, this.field_2320); | ||
} | ||
|
||
@Redirect(method = {"method_1830", "method_1829"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;getHardness(Lnet/minecraft/entity/player/PlayerEntity;)F", ordinal = 0)) | ||
private float forge$blockStrength(Block instance, PlayerEntity playerEntity, @Local(ordinal = 0) int i, @Local(ordinal = 1) int j, @Local(ordinal = 2) int k) { | ||
return ((ForgeBlock) instance).blockStrength(this.world, playerEntity, i, j, k); | ||
} | ||
|
||
@Redirect(method = "method_1834", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;canRemoveBlock(Lnet/minecraft/block/Block;)Z")) | ||
private boolean forge$canHarvestBlock(PlayerEntity instance, Block block, @Local(ordinal = 4) int meta) { | ||
return ((ForgeBlock) block).canHarvestBlock(instance, meta); | ||
} | ||
} |
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