This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
2020-03-24 19:29:41 +00:00
|
|
|
package com.thebrokenrail.sorcerycraft.mixin;
|
|
|
|
|
|
|
|
import com.thebrokenrail.sorcerycraft.client.gui.CastingTableScreen;
|
|
|
|
import net.fabricmc.api.EnvType;
|
|
|
|
import net.fabricmc.api.Environment;
|
|
|
|
import net.minecraft.client.MinecraftClient;
|
|
|
|
import net.minecraft.client.network.ClientPlayerEntity;
|
|
|
|
import net.minecraft.util.Identifier;
|
|
|
|
import org.spongepowered.asm.mixin.Final;
|
|
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
|
|
import org.spongepowered.asm.mixin.Shadow;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
@SuppressWarnings("unused")
|
|
|
|
@Mixin(ClientPlayerEntity.class)
|
|
|
|
@Environment(EnvType.CLIENT)
|
|
|
|
public class MixinClientPlayerEntity extends MixinPlayerEntity {
|
2020-03-27 18:07:47 +00:00
|
|
|
@Shadow
|
|
|
|
@Final
|
|
|
|
protected MinecraftClient client;
|
2020-03-24 19:29:41 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setDiscoveredSpells(Map<Identifier, Integer> spells) {
|
|
|
|
super.setDiscoveredSpells(spells);
|
|
|
|
if (client.currentScreen instanceof CastingTableScreen) {
|
|
|
|
((CastingTableScreen) client.currentScreen).resetIndex();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|