Updating looom and yarn

This commit is contained in:
samo_lego 2020-03-10 15:15:57 +01:00
parent c86c55f421
commit 52687dac54
4 changed files with 11 additions and 15 deletions

View File

@ -1,5 +1,5 @@
plugins { plugins {
id 'fabric-loom' version '0.2.5-SNAPSHOT' id 'fabric-loom' version '0.2.6-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }
@ -16,11 +16,11 @@ minecraft {
dependencies { dependencies {
//to change the versions see the gradle.properties file //to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}" minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modCompile "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway. // Fabric API. This is technically optional, but you probably want it anyway.
modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Argon2 library for password hashing // Argon2 library for password hashing
implementation 'de.mkammerer:argon2-jvm:2.6' implementation 'de.mkammerer:argon2-jvm:2.6'

View File

@ -2,12 +2,12 @@
org.gradle.jvmargs=-Xmx1G org.gradle.jvmargs=-Xmx1G
# Fabric properties # Fabric properties
minecraft_version=20w08a minecraft_version=20w10a
yarn_mappings=20w08a+build.2 yarn_mappings=20w10a+build.16
loader_version=0.7.8+build.184 loader_version=0.7.8+build.187
#Fabric api #Fabric api
fabric_version=0.4.33+build.299-1.16 fabric_version=0.5.1+build.305-1.16
# Mod Properties # Mod Properties
mod_version = 1.2.0 mod_version = 1.2.0

View File

@ -32,7 +32,8 @@ public class AuthEventHandler {
SimpleAuth.deauthenticatedUsers.add(player); SimpleAuth.deauthenticatedUsers.add(player);
/*CompoundTag loginTries = new CompoundTag(); /*CompoundTag loginTries = new CompoundTag();
loginTries.putInt("loginTries", 0); loginTries.putInt("loginTries", 0);
player.saveToTag(loginTries);*/ player.saveToTag(loginTries);
player.writeCustomDataToTag(loginTries);*/
// Player not authenticated // Player not authenticated
// If clause actually not needed, since we add player to deauthenticated hashset above // If clause actually not needed, since we add player to deauthenticated hashset above
if (!SimpleAuth.isAuthenticated(player)) { if (!SimpleAuth.isAuthenticated(player)) {

View File

@ -1,15 +1,12 @@
package org.samo_lego.simpleauth.mixin; package org.samo_lego.simpleauth.mixin;
import net.minecraft.container.PlayerContainer;
import net.minecraft.entity.ItemEntity; import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import org.samo_lego.simpleauth.event.item.DropItemCallback; import org.samo_lego.simpleauth.event.item.DropItemCallback;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin; 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.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@ -17,8 +14,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(PlayerEntity.class) @Mixin(PlayerEntity.class)
public abstract class MixinPlayerEntity { public abstract class MixinPlayerEntity {
@Shadow @Final public PlayerContainer playerContainer;
// Thanks to PR https://github.com/FabricMC/fabric/pull/260 and AbusedLib https://github.com/abused/AbusedLib // Thanks to PR https://github.com/FabricMC/fabric/pull/260 and AbusedLib https://github.com/abused/AbusedLib
@Inject(method = "dropItem(Lnet/minecraft/item/ItemStack;ZZ)Lnet/minecraft/entity/ItemEntity;", at = @At("INVOKE"), cancellable = true) @Inject(method = "dropItem(Lnet/minecraft/item/ItemStack;ZZ)Lnet/minecraft/entity/ItemEntity;", at = @At("INVOKE"), cancellable = true)
private void dropItem(ItemStack stack, boolean dropAtFeet, boolean saveThrower, CallbackInfoReturnable<ItemEntity> cir) { private void dropItem(ItemStack stack, boolean dropAtFeet, boolean saveThrower, CallbackInfoReturnable<ItemEntity> cir) {
@ -28,7 +23,7 @@ public abstract class MixinPlayerEntity {
if (result == ActionResult.FAIL) { if (result == ActionResult.FAIL) {
// Canceling the item drop, as well as giving the items back to player (and updating inv with packet) // Canceling the item drop, as well as giving the items back to player (and updating inv with packet)
player.giveItemStack(stack); player.giveItemStack(stack);
playerContainer.sendContentUpdates(); player.inventory.updateItems();
cir.cancel(); cir.cancel();
} }
} }