Skip to content

Commit

Permalink
Vault crash is halfway fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
triphora committed Jun 16, 2021
1 parent e2f9f17 commit 2f49d1d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties - check these on <https://fabricmc.net/versions.html>
minecraft_version=1.17
yarn_mappings=1
loader_version=0.11.3
fabric_version=0.34.9+1.17
yarn_mappings=11
loader_version=0.11.6
fabric_version=0.35.2+1.17
# Mod Properties
mod_version=2.0.0-SNAPSHOT
mod_version=2.0.0-alpha.1
maven_group=dev.frydae
archives_base_name=empire-minecraft-utilities
# Dependencies
modmenu_version=2.0.0-beta.7
modmenu_version=2.0.2
cloth_version=5.0.34
lombok_version=1.18.20
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
// import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.systems.RenderSystem;
import dev.frydae.emcutils.accessors.ScreenAccessor;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
Expand Down Expand Up @@ -34,7 +35,7 @@ public class VaultScreen extends HandledScreen<VaultScreenHandler> implements Sc

public VaultScreen(VaultScreenHandler handler, PlayerInventory inventory, Text title) {
super(handler, inventory, title);
this.client = MinecraftClient.getInstance();
super.init(MinecraftClient.getInstance(), MinecraftClient.getInstance().getWindow().getScaledWidth(), MinecraftClient.getInstance().getWindow().getScaledHeight());
this.passEvents = false;
this.rows = 6;
this.backgroundHeight = 114 + 7 * 18;
Expand Down Expand Up @@ -116,11 +117,10 @@ private void drawButton(MatrixStack matrices, ItemStack button, int mouseX, int
}

protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) {
// RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
int x = (this.width - this.backgroundWidth) / 2;
int y = (this.height - this.backgroundHeight) / 2;
assert this.client != null;
this.client.getTextureManager().bindTexture(TEXTURE);
MinecraftClient.getInstance().getTextureManager().bindTexture(TEXTURE);
this.drawTexture(matrices, x, y, 0, 0, this.backgroundWidth, (rows + 1) * 18 + 17);
this.drawTexture(matrices, x, y + this.rows * 18 + 17, 0, 126, this.backgroundWidth, 128);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ public class ConnectScreenMixin {
@Inject(method = "connect(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/network/ServerAddress;)V", at = @At(value = "HEAD"))
public void onConnect(MinecraftClient client, ServerAddress address, CallbackInfo ci) {
Util.setServerAddress(String.valueOf(address));
Util.IS_ON_EMC = address.equals(".*.emc.gs?.");
// Util.IS_ON_EMC = address.equals(".*.emc.gs?.");
}
}
2 changes: 1 addition & 1 deletion src/main/java/dev/frydae/emcutils/utils/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.stream.Collectors;

public class Util {
public static boolean IS_ON_EMC = false;
public static boolean IS_ON_EMC = true;
@Getter
@Setter
private static String serverAddress;
Expand Down

0 comments on commit 2f49d1d

Please sign in to comment.