forked from KryptonCaptain/Et-Futurum
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed jitter when attempting to pick up items from slots Possibly fixed spectators being able to body-block players Removed spectators from being considered as Creative mode players Fixed spectators having an item stuck in their cursor if someone else changes their game mode while they were dragging items, it'll get put in their inventory or thrown on the ground if no room is available. Fixed AE2 containers largely ignoring many checks (including `canTakeStack`) by just no-opping their inventory code for spectators Fixed spectators being able to spectate spectators
- Loading branch information
1 parent
a5af4fb
commit d4eb326
Showing
10 changed files
with
99 additions
and
17 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
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
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
20 changes: 20 additions & 0 deletions
20
src/main/java/ganymedes01/etfuturum/mixins/early/spectator/MixinSlot.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,20 @@ | ||
package ganymedes01.etfuturum.mixins.early.spectator; | ||
|
||
import ganymedes01.etfuturum.spectator.SpectatorMode; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.inventory.Slot; | ||
import net.minecraft.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(Slot.class) | ||
public class MixinSlot { | ||
@Inject(method = "canTakeStack", at = @At(value = "HEAD"), cancellable = true) | ||
private void cancelTake(EntityPlayer p_82869_1_, CallbackInfoReturnable<Boolean> cir) { | ||
if(SpectatorMode.isSpectator(p_82869_1_)) { | ||
cir.setReturnValue(false); | ||
} | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
src/main/java/ganymedes01/etfuturum/mixins/late/spectator/MixinPacketInventoryAction.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,22 @@ | ||
package ganymedes01.etfuturum.mixins.late.spectator; | ||
|
||
import appeng.container.AEBaseContainer; | ||
import appeng.core.sync.packets.PacketInventoryAction; | ||
import appeng.helpers.InventoryAction; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import ganymedes01.etfuturum.spectator.SpectatorMode; | ||
import net.minecraft.entity.player.EntityPlayerMP; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
@Mixin(PacketInventoryAction.class) | ||
public class MixinPacketInventoryAction { | ||
@WrapOperation(method = "serverPacketData", remap = false, at = @At(value = "INVOKE", | ||
target = "Lappeng/container/AEBaseContainer;doAction(Lnet/minecraft/entity/player/EntityPlayerMP;Lappeng/helpers/InventoryAction;IJ)V")) | ||
private void cancelInventoryActions(AEBaseContainer instance, EntityPlayerMP player, InventoryAction action, int slot, long id, Operation<Void> original) { | ||
if(!SpectatorMode.isSpectator(player)) { | ||
original.call(instance, player, action, slot, id); | ||
} | ||
} | ||
} |
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