Skip to content

Commit

Permalink
Fix #1521 IC2 + Foresty crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Nedelosk committed Dec 19, 2016
1 parent 7b1aead commit 408d1dc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/forestry/core/fluids/Fluids.java
Expand Up @@ -21,6 +21,7 @@
import java.util.Map;

import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -260,16 +261,19 @@ public DrinkProperties getDrinkProperties() {
}

public boolean flowTextureExists() {
if (FMLCommonHandler.instance().getSide() == Side.SERVER) {
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
return true;
}
try {
ResourceLocation resourceLocation = new ForestryResource("blocks/liquid/" + getTag() + "_flow");
IResourceManager resourceManager = Proxies.common.getClientInstance().getResourceManager();
return resourceManager.getResource(resourceLocation) != null;
Minecraft minecraft = Proxies.common.getClientInstance();
if(minecraft != null){
IResourceManager resourceManager = minecraft.getResourceManager();
return resourceManager.getResource(resourceLocation) != null;
}
} catch (IOException e) {
return false;
}
return false;
}

public ResourceLocation[] getResources() {
Expand Down

0 comments on commit 408d1dc

Please sign in to comment.