add transparent blocks
This commit is contained in:
parent
2b6db5fabd
commit
0039e70591
|
@ -137,3 +137,24 @@
|
||||||
teal (0x167E86), dark_aqua (0x3A8E8C), dark_dull_pink (0x562C3E),
|
teal (0x167E86), dark_aqua (0x3A8E8C), dark_dull_pink (0x562C3E),
|
||||||
bright_teal (0x14B485), deepslate_gray (0x646464),
|
bright_teal (0x14B485), deepslate_gray (0x646464),
|
||||||
raw_iron_pink (0xD8AF93), lichen_green (0x7FA796)
|
raw_iron_pink (0xD8AF93), lichen_green (0x7FA796)
|
||||||
|
|
||||||
|
"renderLayer" ~ string
|
||||||
|
one of:
|
||||||
|
solid, cutout_mipped, cutout, translucent,
|
||||||
|
translucent_moving_block, translucent_no_crumbling,
|
||||||
|
leash, water_mask, armor_glint, armor_entity_glint, glint_translucent,
|
||||||
|
glint, direct_glint, entity_glint, direct_entity_glint, text_background,
|
||||||
|
text_background_see_through, lightning, tripwire, end_portal,
|
||||||
|
end_gateway, lines, line_strip, debug_filled_box, debug_quads,
|
||||||
|
debug_section_quads, gui, gui_overlay, gui_text_highlight,
|
||||||
|
gui_ghost_recipe_overlay
|
||||||
|
different renderLayers allow different graphical effects.
|
||||||
|
Only the first 4 are interesting
|
||||||
|
solid = solid block no transparency
|
||||||
|
stone ...
|
||||||
|
cutout_mipped = 100% or no transparency, ?gets softened far away when mipmapping is enabled?
|
||||||
|
glass, leaves and similar
|
||||||
|
cutout = 100% or no transparency
|
||||||
|
flowers, saplings...
|
||||||
|
translucent = full alpha support
|
||||||
|
ice, stained glass, portal...
|
||||||
|
|
17
build.gradle
17
build.gradle
|
@ -35,17 +35,6 @@ repositories {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
|
||||||
splitEnvironmentSourceSets()
|
|
||||||
|
|
||||||
mods {
|
|
||||||
"modid" {
|
|
||||||
sourceSet sourceSets.main
|
|
||||||
sourceSet sourceSets.client
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// To change the versions see the gradle.properties file
|
// To change the versions see the gradle.properties file
|
||||||
|
@ -70,15 +59,13 @@ dependencies {
|
||||||
include(modApi("de.siphalor.tweed4:tweed4-tailor-screen-$project.minecraft_major_version"))
|
include(modApi("de.siphalor.tweed4:tweed4-tailor-screen-$project.minecraft_major_version"))
|
||||||
|
|
||||||
|
|
||||||
modImplementation("me.shedaniel.cloth:cloth-config-fabric:$project.cloth_config_version") {
|
modImplementation("me.shedaniel.cloth:cloth-config-fabric:$project.cloth_config_version")
|
||||||
exclude(group: "net.fabricmc.fabric-api")
|
|
||||||
}
|
|
||||||
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
|
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations.include.transitive = true
|
configurations.include.transitive = true
|
||||||
configurations.include.dependencies.each {
|
configurations.include.dependencies.each {
|
||||||
if (!it.name.contains("bom")) {
|
if (!it.name.contains("bom") && !it.name.contains("fabric")) {
|
||||||
it.transitive = false
|
it.transitive = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
|
||||||
maven {
|
maven {
|
||||||
name = 'Fabric'
|
name = 'Fabric'
|
||||||
url = 'https://maven.fabricmc.net/'
|
url = 'https://maven.fabricmc.net/'
|
||||||
}
|
}
|
||||||
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -78,6 +78,8 @@ public class BlockResourceLoader extends GenericManualResourceLoader<Pair<Block,
|
||||||
if (burnChance != -1 && spreadChance != -1) {
|
if (burnChance != -1 && spreadChance != -1) {
|
||||||
FlammableBlockRegistry.getDefaultInstance().add(resB, spreadChance, burnChance);
|
FlammableBlockRegistry.getDefaultInstance().add(resB, spreadChance, burnChance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SimpleCreatorMod.BLOCKS_RENDER_LAYER.add(new Pair<>(resB, bspj.renderLayer));
|
||||||
return new Pair<>(resB, resI);
|
return new Pair<>(resB, resI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,5 +29,6 @@ public class BlockSettingsPojo {
|
||||||
public boolean noBlockBreakParticles = false;
|
public boolean noBlockBreakParticles = false;
|
||||||
public boolean requiresTool = false;
|
public boolean requiresTool = false;
|
||||||
public boolean breaksInstantly = false;
|
public boolean breaksInstantly = false;
|
||||||
String mapColor = "stone";
|
public String renderLayer = "solid";
|
||||||
|
public String mapColor = "stone";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
package quimufu.simple_creator;
|
package quimufu.simple_creator;
|
||||||
|
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.util.Pair;
|
||||||
import org.apache.logging.log4j.Level;
|
import org.apache.logging.log4j.Level;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class SimpleCreatorMod implements ModInitializer {
|
public class SimpleCreatorMod implements ModInitializer {
|
||||||
|
|
||||||
|
public static List<Pair<Block, String>> BLOCKS_RENDER_LAYER = new ArrayList<>();
|
||||||
public static Logger LOGGER = LogManager.getLogger();
|
public static Logger LOGGER = LogManager.getLogger();
|
||||||
public static ItemResourceLoader irl = new ItemResourceLoader();
|
public static ItemResourceLoader irl = new ItemResourceLoader();
|
||||||
public static BlockResourceLoader brl = new BlockResourceLoader();
|
public static BlockResourceLoader brl = new BlockResourceLoader();
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
package quimufu.simple_creator;
|
||||||
|
|
||||||
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
|
import net.fabricmc.api.EnvType;
|
||||||
|
import net.fabricmc.api.Environment;
|
||||||
|
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.render.RenderLayer;
|
||||||
|
import net.minecraft.util.Pair;
|
||||||
|
import org.apache.logging.log4j.Level;
|
||||||
|
|
||||||
|
@Environment(EnvType.CLIENT)
|
||||||
|
public class SimpleCreatorModClient implements ClientModInitializer {
|
||||||
|
@Override
|
||||||
|
public void onInitializeClient() {
|
||||||
|
for (Pair<Block, String> blockRenderLayerPair : SimpleCreatorMod.BLOCKS_RENDER_LAYER) {
|
||||||
|
BlockRenderLayerMap.INSTANCE.putBlock(blockRenderLayerPair.getLeft(), getRenderLayer(blockRenderLayerPair.getRight()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private net.minecraft.client.render.RenderLayer getRenderLayer(String renderLayer) {
|
||||||
|
switch (renderLayer.toUpperCase()){
|
||||||
|
case "SOLID":
|
||||||
|
return RenderLayer.getSolid();
|
||||||
|
case "CUTOUT_MIPPED":
|
||||||
|
return RenderLayer.getCutoutMipped();
|
||||||
|
case "CUTOUT":
|
||||||
|
return RenderLayer.getCutout();
|
||||||
|
case "TRANSLUCENT":
|
||||||
|
return RenderLayer.getTranslucent();
|
||||||
|
case "TRANSLUCENT_MOVING_BLOCK":
|
||||||
|
return RenderLayer.getTranslucentMovingBlock();
|
||||||
|
case "TRANSLUCENT_NO_CRUMBLING":
|
||||||
|
return RenderLayer.getTranslucentNoCrumbling();
|
||||||
|
case "LEASH":
|
||||||
|
return RenderLayer.getLeash();
|
||||||
|
case "WATER_MASK":
|
||||||
|
return RenderLayer.getWaterMask();
|
||||||
|
case "ARMOR_GLINT":
|
||||||
|
return RenderLayer.getArmorGlint();
|
||||||
|
case "ARMOR_ENTITY_GLINT":
|
||||||
|
return RenderLayer.getArmorEntityGlint();
|
||||||
|
case "GLINT_TRANSLUCENT":
|
||||||
|
return RenderLayer.getGlintTranslucent();
|
||||||
|
case "GLINT":
|
||||||
|
return RenderLayer.getGlint();
|
||||||
|
case "DIRECT_GLINT":
|
||||||
|
return RenderLayer.getDirectGlint();
|
||||||
|
case "ENTITY_GLINT":
|
||||||
|
return RenderLayer.getEntityGlint();
|
||||||
|
case "DIRECT_ENTITY_GLINT":
|
||||||
|
return RenderLayer.getDirectEntityGlint();
|
||||||
|
case "TEXT_BACKGROUND":
|
||||||
|
return RenderLayer.getTextBackground();
|
||||||
|
case "TEXT_BACKGROUND_SEE_THROUGH":
|
||||||
|
return RenderLayer.getTextBackgroundSeeThrough();
|
||||||
|
case "LIGHTNING":
|
||||||
|
return RenderLayer.getLightning();
|
||||||
|
case "TRIPWIRE":
|
||||||
|
return RenderLayer.getTripwire();
|
||||||
|
case "END_PORTAL":
|
||||||
|
return RenderLayer.getEndPortal();
|
||||||
|
case "END_GATEWAY":
|
||||||
|
return RenderLayer.getEndGateway();
|
||||||
|
case "LINES":
|
||||||
|
return RenderLayer.getLines();
|
||||||
|
case "LINE_STRIP":
|
||||||
|
return RenderLayer.getLineStrip();
|
||||||
|
case "DEBUG_FILLED_BOX":
|
||||||
|
return RenderLayer.getDebugFilledBox();
|
||||||
|
case "DEBUG_QUADS":
|
||||||
|
return RenderLayer.getDebugQuads();
|
||||||
|
case "DEBUG_SECTION_QUADS":
|
||||||
|
return RenderLayer.getDebugSectionQuads();
|
||||||
|
case "GUI":
|
||||||
|
return RenderLayer.getGui();
|
||||||
|
case "GUI_OVERLAY":
|
||||||
|
return RenderLayer.getGuiOverlay();
|
||||||
|
case "GUI_TEXT_HIGHLIGHT":
|
||||||
|
return RenderLayer.getGuiTextHighlight();
|
||||||
|
case "GUI_GHOST_RECIPE_OVERLAY":
|
||||||
|
return RenderLayer.getGuiGhostRecipeOverlay();
|
||||||
|
default:
|
||||||
|
SimpleCreatorMod.log(Level.INFO, "Could not find renderLayer " + renderLayer + " using solid");
|
||||||
|
return RenderLayer.getSolid();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,15 +16,16 @@
|
||||||
"main": [
|
"main": [
|
||||||
"quimufu.simple_creator.SimpleCreatorMod"
|
"quimufu.simple_creator.SimpleCreatorMod"
|
||||||
],
|
],
|
||||||
"client": [],
|
"client": [
|
||||||
"server": [],
|
"quimufu.simple_creator.SimpleCreatorModClient"
|
||||||
|
],
|
||||||
"tweed4:config": [
|
"tweed4:config": [
|
||||||
"quimufu.simple_creator.SimpleCreatorConfig"
|
"quimufu.simple_creator.SimpleCreatorConfig"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mixins": [],
|
"mixins": [],
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.4.0",
|
"fabricloader": ">=0.14.21",
|
||||||
"fabric": "*"
|
"fabric": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user