Compat with Canvas emissive shaders, fixes
This commit is contained in:
parent
bcc3b076c2
commit
b05f5a728f
15 changed files with 210 additions and 6 deletions
|
@ -12,7 +12,6 @@ public class BCLibClient implements ClientModInitializer {
|
|||
ModIntegrationAPI.registerAll();
|
||||
BaseBlockEntityRenders.register();
|
||||
DataExchangeAPI.prepareClientside();
|
||||
|
||||
PostInitAPI.postInit(true);
|
||||
}
|
||||
}
|
||||
|
|
23
src/main/java/ru/bclib/client/models/CustomModelData.java
Normal file
23
src/main/java/ru/bclib/client/models/CustomModelData.java
Normal file
|
@ -0,0 +1,23 @@
|
|||
package ru.bclib.client.models;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class CustomModelData {
|
||||
private static final Set<ResourceLocation> TRANSPARENT_EMISSION = Sets.newConcurrentHashSet();
|
||||
|
||||
public static void clear() {
|
||||
TRANSPARENT_EMISSION.clear();
|
||||
}
|
||||
|
||||
public static void addTransparent(ResourceLocation blockID) {
|
||||
TRANSPARENT_EMISSION.add(blockID);
|
||||
}
|
||||
|
||||
public static boolean isTransparentEmissive(ResourceLocation rawLocation) {
|
||||
String name = rawLocation.getPath().replace("materialmaps/block/", "").replace(".json", "");
|
||||
return TRANSPARENT_EMISSION.contains(new ResourceLocation(rawLocation.getNamespace(), name));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package ru.bclib.client.render;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class EmissiveTextureInfo {
|
||||
private static final Set<ResourceLocation> EMISSIVE_TEXTURES = Sets.newHashSet();
|
||||
private static final Set<ResourceLocation> EMISSIVE_BLOCKS = Sets.newHashSet();
|
||||
|
||||
public static void clear() {
|
||||
EMISSIVE_TEXTURES.clear();
|
||||
EMISSIVE_BLOCKS.clear();
|
||||
}
|
||||
|
||||
public static void addTexture(ResourceLocation texture) {
|
||||
EMISSIVE_TEXTURES.add(texture);
|
||||
}
|
||||
|
||||
public static void addBlock(ResourceLocation blockID) {
|
||||
EMISSIVE_BLOCKS.add(blockID);
|
||||
}
|
||||
|
||||
public static boolean isEmissiveTexture(ResourceLocation texture) {
|
||||
return EMISSIVE_TEXTURES.contains(texture);
|
||||
}
|
||||
|
||||
public static boolean isEmissiveBlock(ResourceLocation blockID) {
|
||||
return EMISSIVE_BLOCKS.contains(blockID);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue