1-16-pre2
This commit is contained in:
parent
8e15ce6e21
commit
f5597a9626
|
@ -1,5 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '0.2.7-SNAPSHOT'
|
id 'fabric-loom' version '0.4-SNAPSHOT'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class AuthCommand {
|
||||||
.then(argument("position", BlockPosArgumentType.blockPos())
|
.then(argument("position", BlockPosArgumentType.blockPos())
|
||||||
.executes(ctx -> setSpawn(
|
.executes(ctx -> setSpawn(
|
||||||
ctx.getSource(),
|
ctx.getSource(),
|
||||||
DimensionArgumentType.getDimensionArgument(ctx, "dimension").getValue(),
|
DimensionArgumentType.getDimensionArgument(ctx, "dimension").getRegistryKey().getValue(),
|
||||||
BlockPosArgumentType.getLoadedBlockPos(ctx, "position").getX(),
|
BlockPosArgumentType.getLoadedBlockPos(ctx, "position").getX(),
|
||||||
// +1 to not spawn player in ground
|
// +1 to not spawn player in ground
|
||||||
BlockPosArgumentType.getLoadedBlockPos(ctx, "position").getY() + 1,
|
BlockPosArgumentType.getLoadedBlockPos(ctx, "position").getY() + 1,
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
import static net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action.SWAP_HELD_ITEMS;
|
import static net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action.SWAP_ITEM_WITH_OFFHAND;
|
||||||
|
|
||||||
@Mixin(ServerPlayNetworkHandler.class)
|
@Mixin(ServerPlayNetworkHandler.class)
|
||||||
public abstract class MixinServerPlayNetworkHandler {
|
public abstract class MixinServerPlayNetworkHandler {
|
||||||
|
@ -50,7 +50,7 @@ public abstract class MixinServerPlayNetworkHandler {
|
||||||
cancellable = true
|
cancellable = true
|
||||||
)
|
)
|
||||||
private void onPlayerAction(PlayerActionC2SPacket packet, CallbackInfo ci) {
|
private void onPlayerAction(PlayerActionC2SPacket packet, CallbackInfo ci) {
|
||||||
if(packet.getAction() == SWAP_HELD_ITEMS) {
|
if(packet.getAction() == SWAP_ITEM_WITH_OFFHAND) {
|
||||||
ActionResult result = TakeItemCallback.EVENT.invoker().onTakeItem(this.player);
|
ActionResult result = TakeItemCallback.EVENT.invoker().onTakeItem(this.player);
|
||||||
if (result == ActionResult.FAIL) {
|
if (result == ActionResult.FAIL) {
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
|
|
Loading…
Reference in New Issue