Skip to content

Commit

Permalink
Merge pull request #24 from GTNewHorizons/fix-angelica-crash
Browse files Browse the repository at this point in the history
Fix crash with Angelica when looking at hydrodam pressurized water

(cherry picked from commit 94790e4)
  • Loading branch information
Dream-Master committed May 20, 2024
1 parent e1e4f48 commit b15fe63
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/sinthoras/hydroenergy/HETags.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class HETags {
public static final String MODID = "GRADLETOKEN_MODID";
public static final String MODNAME = "GRADLETOKEN_MODNAME";
public static final String VERSION = "GRADLETOKEN_VERSION";
public static final String GROUPNAME = "GRADLETOKEN_GROUPNAME";
public static final String GROUPNAME = "com.sinthoras.hydroenergy";
public static final String DEPENDENCIES = "required-after: gregtech;" + "required-after: tectech@[5.0,)";

public static final String waterLevel = "walv";
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/sinthoras/hydroenergy/config/HEConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.sinthoras.hydroenergy.HEUtil;

import cpw.mods.fml.common.Loader;
import gregtech.api.enums.GT_Values;

public class HEConfig {
Expand Down Expand Up @@ -120,6 +121,8 @@ public static void syncronizeConfiguration(java.io.File configurationFile) {
+ "mod. But be warned: you will have limited render capabilities!");
useLimitedRendering = useLimitedRenderingProperty.getBoolean();

if (Loader.isModLoaded("angelica")) useLimitedRendering = true;

Property forceOpenGLProperty = configuration.get(
Categories.general,
"forceOpenGL",
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/com/sinthoras/hydroenergy/hooks/HEHooksFML.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class HEHooksFML {

private float waterLevel = 85.0f;
private int sign = 1;
private boolean isLoggedIn = false;

@SubscribeEvent
public void onEvent(ServerTickEvent event) {
Expand All @@ -41,16 +42,23 @@ public void onEvent(PlayerLoggedInEvent event) {
HEServer.instance.synchronizeClient(event);
}

@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onEvent(FMLNetworkEvent.ClientConnectedToServerEvent event) {
isLoggedIn = true;
}

@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onEvent(FMLNetworkEvent.ClientDisconnectionFromServerEvent event) {
HEClient.onDisconnect();
isLoggedIn = false;
}

@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onEvent(TickEvent.ClientTickEvent event) {
if (event.phase == TickEvent.Phase.END) {
if (event.phase == TickEvent.Phase.END && isLoggedIn) {
HELightManager.onTick();
}
}
Expand Down

0 comments on commit b15fe63

Please sign in to comment.