Add tinted variant to Ethereal glass and fix issue with updates file #10
@ -49,7 +49,11 @@ public class EtherealGlass extends GlassBlock {
|
|||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void appendHoverText(ItemStack stack, @Nullable BlockGetter getter, List<Component> components, TooltipFlag flag) {
|
public void appendHoverText(ItemStack stack, @Nullable BlockGetter getter, List<Component> components, TooltipFlag flag) {
|
||||||
super.appendHoverText(stack, getter, components, flag);
|
super.appendHoverText(stack, getter, components, flag);
|
||||||
components.add(Component.translatable("tooltip.utamacraft.ethereal_glass").withStyle(ChatFormatting.GRAY));
|
components.add(Component.translatable(getTooltip()).withStyle(ChatFormatting.GRAY));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getTooltip() {
|
||||||
|
return "tooltip.utamacraft.ethereal_glass";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Boolean blockSpawning(BlockState state, BlockGetter reader, BlockPos pos, EntityType<?> entity) {
|
private static Boolean blockSpawning(BlockState state, BlockGetter reader, BlockPos pos, EntityType<?> entity) {
|
||||||
|
@ -20,6 +20,8 @@ public class ModBlocks {
|
|||||||
|
|
||||||
public static final RegistryObject<Block> ETHEREAL_GLASS =
|
public static final RegistryObject<Block> ETHEREAL_GLASS =
|
||||||
registerBlock("ethereal_glass", EtherealGlass::new);
|
registerBlock("ethereal_glass", EtherealGlass::new);
|
||||||
|
public static final RegistryObject<Block> TINTED_ETHEREAL_GLASS =
|
||||||
|
registerBlock("tinted_ethereal_glass", TintedEtherealGlass::new);
|
||||||
|
|
||||||
private static <T extends Block> RegistryObject<T> registerBlock(String name, Supplier<T> block) {
|
private static <T extends Block> RegistryObject<T> registerBlock(String name, Supplier<T> block) {
|
||||||
RegistryObject<T> registered_block = BLOCKS.register(name, block);
|
RegistryObject<T> registered_block = BLOCKS.register(name, block);
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
package net.banutama.utamacraft.block;
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.world.level.BlockGetter;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
|
||||||
|
public class TintedEtherealGlass extends EtherealGlass {
|
||||||
|
@Override
|
||||||
|
public int getLightBlock(BlockState state, BlockGetter world, BlockPos pos) {
|
||||||
|
return world.getMaxLightLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getTooltip() {
|
||||||
|
return "tooltip.utamacraft.tinted_ethereal_glass";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": {
|
||||||
|
"model": "utamacraft:block/tinted_ethereal_glass"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,10 @@
|
|||||||
{
|
{
|
||||||
"block.utamacraft.ethereal_glass": "Ethereal Glass",
|
"block.utamacraft.ethereal_glass": "Ethereal Glass",
|
||||||
|
"block.utamacraft.tinted_ethereal_glass": "Tinted Ethereal Glass",
|
||||||
"item.utamacraft.player_peripheral": "Player peripheral",
|
"item.utamacraft.player_peripheral": "Player peripheral",
|
||||||
"item.utamacraft.utamacraft_logo": "Utamacraft",
|
"item.utamacraft.utamacraft_logo": "Utamacraft",
|
||||||
"itemGroup.utamacraft_tab": "Utamacraft",
|
"itemGroup.utamacraft_tab": "Utamacraft",
|
||||||
"tooltip.utamacraft.ethereal_glass": "Glass that is not solid to players",
|
"tooltip.utamacraft.ethereal_glass": "Glass that is not solid to players",
|
||||||
|
"tooltip.utamacraft.tinted_ethereal_glass": "Glass that is not solid to players and blocks light",
|
||||||
"turtle.utamacraft.player_turtle": "Player"
|
"turtle.utamacraft.player_turtle": "Player"
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"parent": "block/cube_all",
|
||||||
|
"render_type": "translucent",
|
||||||
|
"textures": {
|
||||||
|
"all": "utamacraft:block/tinted_ethereal_glass"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"parent": "utamacraft:block/tinted_ethereal_glass"
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
BIN
textures/tinted_ethereal_glass.afdesign
Normal file
BIN
textures/tinted_ethereal_glass.afdesign
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user