1-16-pre2

This commit is contained in:
samo_lego 2020-06-10 22:38:42 +02:00
parent 8e15ce6e21
commit f5597a9626
3 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.2.7-SNAPSHOT'
id 'fabric-loom' version '0.4-SNAPSHOT'
id 'maven-publish'
}

View File

@ -55,7 +55,7 @@ public class AuthCommand {
.then(argument("position", BlockPosArgumentType.blockPos())
.executes(ctx -> setSpawn(
ctx.getSource(),
DimensionArgumentType.getDimensionArgument(ctx, "dimension").getValue(),
DimensionArgumentType.getDimensionArgument(ctx, "dimension").getRegistryKey().getValue(),
BlockPosArgumentType.getLoadedBlockPos(ctx, "position").getX(),
// +1 to not spawn player in ground
BlockPosArgumentType.getLoadedBlockPos(ctx, "position").getY() + 1,

View File

@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
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)
public abstract class MixinServerPlayNetworkHandler {
@ -50,7 +50,7 @@ public abstract class MixinServerPlayNetworkHandler {
cancellable = true
)
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);
if (result == ActionResult.FAIL) {
ci.cancel();