fixed mixin warnings

This commit is contained in:
YuRaNnNzZZ 2023-06-09 14:38:56 +03:00
parent e660810c73
commit 67aec1a731
Signed by: YuRaNnNzZZ
GPG Key ID: 5F71738C85A6006D
2 changed files with 6 additions and 4 deletions

View File

@ -10,6 +10,7 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistries;
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.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@ -23,7 +24,9 @@ import java.util.function.Predicate;
@Mixin(Inventory.class) @Mixin(Inventory.class)
public class MixinInventory { public class MixinInventory {
@Shadow Player player; @Final
@Shadow
public Player player;
@Inject( @Inject(
method = "add(ILnet/minecraft/world/item/ItemStack;)Z", method = "add(ILnet/minecraft/world/item/ItemStack;)Z",

View File

@ -15,8 +15,6 @@ import ru.dbotthepony.mc.otm.config.ServerConfig;
import ru.dbotthepony.mc.otm.core.util.ExperienceUtilsKt; import ru.dbotthepony.mc.otm.core.util.ExperienceUtilsKt;
import ru.dbotthepony.mc.otm.registry.MItems; import ru.dbotthepony.mc.otm.registry.MItems;
import java.util.Random;
@SuppressWarnings("ConstantConditions") @SuppressWarnings("ConstantConditions")
@Mixin(LivingEntity.class) @Mixin(LivingEntity.class)
public class MixinLivingEntity { public class MixinLivingEntity {
@ -38,7 +36,8 @@ public class MixinLivingEntity {
} }
} }
@Shadow Player lastHurtByPlayer; @Shadow
protected Player lastHurtByPlayer;
@Inject( @Inject(
method = "dropExperience()V", method = "dropExperience()V",