Fix water rendering overlay on glass blocks

This commit is contained in:
Snownee 2020-11-08 16:29:58 +08:00
parent dbfe7f93fa
commit 073e3980ee
4 changed files with 29 additions and 2 deletions

View file

@ -0,0 +1,16 @@
{
"replace": false,
"values": [
"create:tiled_glass",
"create:framed_glass",
"create:horizontal_framed_glass",
"create:vertical_framed_glass",
"create:oak_window",
"create:spruce_window",
"create:birch_window",
"create:jungle_window",
"create:acacia_window",
"create:dark_oak_window",
"create:ornate_iron_window"
]
}

View file

@ -29,6 +29,7 @@ import net.minecraft.block.GlassBlock;
import net.minecraft.block.SandBlock;
import net.minecraft.block.WoodType;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.Tags;
@ -45,7 +46,7 @@ public class AllPaletteBlocks {
.addLayer(() -> RenderType::getCutoutMipped)
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(Tags.Items.GLASS_COLORLESS), c::get))
.blockstate(palettesCubeAll())
.tag(Tags.Blocks.GLASS_COLORLESS)
.tag(Tags.Blocks.GLASS_COLORLESS, BlockTags.IMPERMEABLE)
.item()
.tag(Tags.Items.GLASS_COLORLESS)
.build()

View file

@ -2,7 +2,10 @@ package com.simibubi.create.content.palettes;
import net.minecraft.block.BlockState;
import net.minecraft.block.GlassBlock;
import net.minecraft.fluid.IFluidState;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ILightReader;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@ -19,4 +22,9 @@ public class ConnectedGlassBlock extends GlassBlock {
: super.isSideInvisible(state, adjacentBlockState, side);
}
@Override
public boolean shouldDisplayFluidOverlay(BlockState state, ILightReader world, BlockPos pos, IFluidState fluidState) {
return true;
}
}

View file

@ -29,6 +29,7 @@ import net.minecraft.block.Blocks;
import net.minecraft.block.WoodType;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.data.ShapedRecipeBuilder;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.generators.ModelFile;
@ -77,6 +78,7 @@ public class WindowGen {
.loot((t, g) -> t.registerSilkTouch(g))
.blockstate((c, p) -> p.simpleBlock(c.get(), p.models()
.cubeColumn(c.getName(), sideTexture.apply(c.getName()), endTexture.apply(c.getName()))))
.tag(BlockTags.IMPERMEABLE)
.simpleItem()
.register();
}
@ -89,7 +91,7 @@ public class WindowGen {
.loot((t, g) -> t.registerSilkTouch(g))
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(Tags.Items.GLASS_COLORLESS), c::get))
.blockstate((c, p) -> BlockStateGen.cubeAll(c, p, "palettes/", "framed_glass"))
.tag(Tags.Blocks.GLASS_COLORLESS)
.tag(Tags.Blocks.GLASS_COLORLESS, BlockTags.IMPERMEABLE)
.item()
.tag(Tags.Items.GLASS_COLORLESS)
.model((c, p) -> p.cubeColumn(c.getName(), p.modLoc(palettesDir() + c.getName()),