Compare commits
1 Commits
b8475b34ba
...
ae50cf0390
Author | SHA1 | Date | |
---|---|---|---|
ae50cf0390 |
@ -3,9 +3,6 @@
|
|||||||
**1.15.2 Port**
|
**1.15.2 Port**
|
||||||
* Tweak Steadfast Spell
|
* Tweak Steadfast Spell
|
||||||
|
|
||||||
**1.2.6**
|
|
||||||
* Fix Potential Client-Server De-sync Bug
|
|
||||||
|
|
||||||
**1.2.5**
|
**1.2.5**
|
||||||
* Fix Casting Table Bug
|
* Fix Casting Table Bug
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
|||||||
fabric_loader_version = 0.7.8+build.189
|
fabric_loader_version = 0.7.8+build.189
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.2.6
|
mod_version = 1.2.5
|
||||||
maven_group = com.thebrokenrail
|
maven_group = com.thebrokenrail
|
||||||
archives_base_name = sorcerycraft
|
archives_base_name = sorcerycraft
|
||||||
|
|
||||||
|
@ -21,9 +21,9 @@ import net.minecraft.util.math.MathHelper;
|
|||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public class CastingTableScreen extends ContainerScreen<CastingTableScreenHandler> {
|
public class CastingTableScreen extends ContainerScreen<CastingTableScreenHandler> {
|
||||||
private static final Identifier TEXTURE = new Identifier("textures/gui/container/villager2.png");
|
private static final Identifier TEXTURE = new Identifier("textures/gui/container/villager2.png");
|
||||||
private int selectedIndex = 0;
|
private int selectedIndex;
|
||||||
private int indexStartOffset = 0;
|
private int indexStartOffset;
|
||||||
private boolean scrolling = false;
|
private boolean scrolling;
|
||||||
|
|
||||||
public CastingTableScreen(CastingTableScreenHandler container, PlayerInventory inventory, Text title) {
|
public CastingTableScreen(CastingTableScreenHandler container, PlayerInventory inventory, Text title) {
|
||||||
super(container, inventory, title);
|
super(container, inventory, title);
|
||||||
@ -40,11 +40,6 @@ public class CastingTableScreen extends ContainerScreen<CastingTableScreenHandle
|
|||||||
renderXPCost();
|
renderXPCost();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetIndex() {
|
|
||||||
selectedIndex = 0;
|
|
||||||
indexStartOffset = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawBackground(float delta, int mouseX, int mouseY) {
|
protected void drawBackground(float delta, int mouseX, int mouseY) {
|
||||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
@ -109,11 +109,6 @@ public class CastingTableScreenHandler extends Container {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetIndex() {
|
|
||||||
index = 0;
|
|
||||||
onContentChanged(inventory);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpells(PlayerEntity player) {
|
public void setSpells(PlayerEntity player) {
|
||||||
if (player.isCreative() ? SorceryCraft.getConfig().limitCastingTable.creative : SorceryCraft.getConfig().limitCastingTable.survival) {
|
if (player.isCreative() ? SorceryCraft.getConfig().limitCastingTable.creative : SorceryCraft.getConfig().limitCastingTable.survival) {
|
||||||
SpellPlayerEntity spellPlayer = (SpellPlayerEntity) player;
|
SpellPlayerEntity spellPlayer = (SpellPlayerEntity) player;
|
||||||
@ -130,7 +125,8 @@ public class CastingTableScreenHandler extends Container {
|
|||||||
} else {
|
} else {
|
||||||
spells = SpellRegistry.getSpells();
|
spells = SpellRegistry.getSpells();
|
||||||
}
|
}
|
||||||
resetIndex();
|
index = 0;
|
||||||
|
onContentChanged(inventory);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canTakeResult(PlayerEntity playerEntity) {
|
public boolean canTakeResult(PlayerEntity playerEntity) {
|
||||||
|
@ -16,7 +16,6 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
@Mixin(ClientPlayNetworkHandler.class)
|
@Mixin(ClientPlayNetworkHandler.class)
|
||||||
public class MixinClientPlayNetworkHandler {
|
public class MixinClientPlayNetworkHandler {
|
||||||
@Shadow
|
@Shadow
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
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 {
|
|
||||||
@Shadow @Final protected MinecraftClient client;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setDiscoveredSpells(Map<Identifier, Integer> spells) {
|
|
||||||
super.setDiscoveredSpells(spells);
|
|
||||||
if (client.currentScreen instanceof CastingTableScreen) {
|
|
||||||
((CastingTableScreen) client.currentScreen).resetIndex();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -5,8 +5,6 @@ import com.thebrokenrail.sorcerycraft.packet.UpdateKnownSpellsS2CPacket;
|
|||||||
import com.thebrokenrail.sorcerycraft.spell.util.SpellHelper;
|
import com.thebrokenrail.sorcerycraft.spell.util.SpellHelper;
|
||||||
import com.thebrokenrail.sorcerycraft.spell.util.SpellPlayerEntity;
|
import com.thebrokenrail.sorcerycraft.spell.util.SpellPlayerEntity;
|
||||||
import com.thebrokenrail.sorcerycraft.spell.util.SpellServerPlayerEntity;
|
import com.thebrokenrail.sorcerycraft.spell.util.SpellServerPlayerEntity;
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
@ -18,7 +16,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@Environment(EnvType.SERVER)
|
|
||||||
@Mixin(ServerPlayerEntity.class)
|
@Mixin(ServerPlayerEntity.class)
|
||||||
public abstract class MixinServerPlayerEntity extends MixinPlayerEntity implements SpellServerPlayerEntity {
|
public abstract class MixinServerPlayerEntity extends MixinPlayerEntity implements SpellServerPlayerEntity {
|
||||||
@Inject(at = @At("HEAD"), method = "copyFrom")
|
@Inject(at = @At("HEAD"), method = "copyFrom")
|
||||||
|
@ -5,8 +5,6 @@ import com.thebrokenrail.sorcerycraft.gui.CastingTableScreenHandler;
|
|||||||
import com.thebrokenrail.sorcerycraft.spell.util.SpellPlayerEntity;
|
import com.thebrokenrail.sorcerycraft.spell.util.SpellPlayerEntity;
|
||||||
import com.thebrokenrail.sorcerycraft.spell.util.SpellHelper;
|
import com.thebrokenrail.sorcerycraft.spell.util.SpellHelper;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.fabricmc.fabric.api.network.PacketContext;
|
import net.fabricmc.fabric.api.network.PacketContext;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||||
@ -15,7 +13,6 @@ import net.minecraft.util.Identifier;
|
|||||||
import net.minecraft.util.PacketByteBuf;
|
import net.minecraft.util.PacketByteBuf;
|
||||||
|
|
||||||
public class UpdateKnownSpellsS2CPacket {
|
public class UpdateKnownSpellsS2CPacket {
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public static void handle(PacketContext context, PacketByteBuf bytes) {
|
public static void handle(PacketContext context, PacketByteBuf bytes) {
|
||||||
CompoundTag tag = bytes.readCompoundTag();
|
CompoundTag tag = bytes.readCompoundTag();
|
||||||
if (context.getPlayer() != null) {
|
if (context.getPlayer() != null) {
|
||||||
|
@ -6,10 +6,9 @@
|
|||||||
"MixinClientPlayNetworkHandler"
|
"MixinClientPlayNetworkHandler"
|
||||||
],
|
],
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"CriterionRegistryHook",
|
|
||||||
"MixinClientPlayerEntity",
|
|
||||||
"MixinPlayerEntity",
|
"MixinPlayerEntity",
|
||||||
"MixinServerPlayerEntity"
|
"MixinServerPlayerEntity",
|
||||||
|
"CriterionRegistryHook"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
Reference in New Issue
Block a user