Fixes #4699: AE's glass should only hide it's sides adjacent to other AE glass.
Also disables spawn on AE's glass same as Vanilla glass.
This commit is contained in:
@@ -20,7 +20,9 @@ package appeng.core.api.definitions;
|
|||||||
|
|
||||||
import static appeng.block.AEBaseBlock.defaultProps;
|
import static appeng.block.AEBaseBlock.defaultProps;
|
||||||
|
|
||||||
|
import net.minecraft.block.AbstractBlock;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.block.DispenserBlock;
|
import net.minecraft.block.DispenserBlock;
|
||||||
import net.minecraft.block.SlabBlock;
|
import net.minecraft.block.SlabBlock;
|
||||||
import net.minecraft.block.SoundType;
|
import net.minecraft.block.SoundType;
|
||||||
@@ -28,6 +30,7 @@ import net.minecraft.block.StairsBlock;
|
|||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.entity.EntityClassification;
|
import net.minecraft.entity.EntityClassification;
|
||||||
|
import net.minecraft.entity.EntityType;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
import net.minecraftforge.common.ToolType;
|
import net.minecraftforge.common.ToolType;
|
||||||
@@ -262,18 +265,20 @@ public final class ApiBlocks implements IBlocks {
|
|||||||
this.chiseledQuartzBlock = deco.block("chiseled_quartz_block", () -> new AEDecorativeBlock(QUARTZ_PROPERTIES))
|
this.chiseledQuartzBlock = deco.block("chiseled_quartz_block", () -> new AEDecorativeBlock(QUARTZ_PROPERTIES))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
this.quartzGlass = registry.features(AEFeature.QUARTZ_GLASS)
|
AbstractBlock.IExtendedPositionPredicate<EntityType<?>> neverAllowSpawn = (p1, p2, p3, p4) -> false;
|
||||||
.block("quartz_glass", () -> new QuartzGlassBlock(defaultProps(Material.GLASS).notSolid()))
|
this.quartzGlass = registry.features(AEFeature.QUARTZ_GLASS).block("quartz_glass", () -> {
|
||||||
.rendering(new BlockRenderingCustomizer() {
|
return new QuartzGlassBlock(defaultProps(Material.GLASS).notSolid().setAllowsSpawn(neverAllowSpawn));
|
||||||
@Override
|
}).rendering(new BlockRenderingCustomizer() {
|
||||||
@OnlyIn(Dist.CLIENT)
|
@Override
|
||||||
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
|
@OnlyIn(Dist.CLIENT)
|
||||||
rendering.renderType(RenderType.getCutout());
|
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
|
||||||
}
|
rendering.renderType(RenderType.getCutout());
|
||||||
}).build();
|
}
|
||||||
|
}).build();
|
||||||
this.quartzVibrantGlass = deco
|
this.quartzVibrantGlass = deco
|
||||||
.block("quartz_vibrant_glass",
|
.block("quartz_vibrant_glass",
|
||||||
() -> new QuartzLampBlock(defaultProps(Material.GLASS).setLightLevel(b -> 15).notSolid()))
|
() -> new QuartzLampBlock(defaultProps(Material.GLASS).setLightLevel(b -> 15).notSolid()
|
||||||
|
.setAllowsSpawn(neverAllowSpawn)))
|
||||||
.addFeatures(AEFeature.DECORATIVE_LIGHTS, AEFeature.QUARTZ_GLASS)
|
.addFeatures(AEFeature.DECORATIVE_LIGHTS, AEFeature.QUARTZ_GLASS)
|
||||||
.rendering(new BlockRenderingCustomizer() {
|
.rendering(new BlockRenderingCustomizer() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -20,11 +20,8 @@ package appeng.decorative.solid;
|
|||||||
|
|
||||||
import net.minecraft.block.AbstractGlassBlock;
|
import net.minecraft.block.AbstractGlassBlock;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
|
|
||||||
import appeng.helpers.AEMaterials;
|
|
||||||
|
|
||||||
public class QuartzGlassBlock extends AbstractGlassBlock {
|
public class QuartzGlassBlock extends AbstractGlassBlock {
|
||||||
|
|
||||||
public QuartzGlassBlock(Properties props) {
|
public QuartzGlassBlock(Properties props) {
|
||||||
@@ -33,8 +30,7 @@ public class QuartzGlassBlock extends AbstractGlassBlock {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSideInvisible(BlockState state, BlockState adjacentBlockState, Direction side) {
|
public boolean isSideInvisible(BlockState state, BlockState adjacentBlockState, Direction side) {
|
||||||
final Material mat = adjacentBlockState.getMaterial();
|
if (adjacentBlockState.getBlock() instanceof QuartzGlassBlock) {
|
||||||
if (mat == Material.GLASS || mat == AEMaterials.GLASS) {
|
|
||||||
if (adjacentBlockState.getRenderType() == state.getRenderType()) {
|
if (adjacentBlockState.getRenderType() == state.getRenderType()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user