Skip to content

Commit

Permalink
Media jars
Browse files Browse the repository at this point in the history
  • Loading branch information
miyucomics committed Jul 5, 2024
1 parent 795c20c commit 8d338df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/main/java/miyucomics/hexical/HexicalClient.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package miyucomics.hexical;

import miyucomics.hexical.registry.HexicalEntities;
import miyucomics.hexical.registry.HexicalItems;
import miyucomics.hexical.registry.HexicalKeybinds;
import miyucomics.hexical.registry.HexicalNetworking;
import miyucomics.hexical.registry.*;
import net.fabricmc.api.ClientModInitializer;

public class HexicalClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
HexicalBlocks.clientInit();
HexicalEntities.clientInit();
HexicalItems.clientInit();
HexicalKeybinds.init();
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/miyucomics/hexical/blocks/MediaJarBlock.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import net.minecraft.util.shape.VoxelShape
import net.minecraft.util.shape.VoxelShapes
import net.minecraft.world.BlockView

class MediaJarBlock : TransparentBlock(Settings.of(Material.GLASS).emissiveLighting { _, _, _ -> true }.luminance { _ -> 15 }.sounds(BlockSoundGroup.GLASS).nonOpaque()) {
class MediaJarBlock : TransparentBlock(Settings.of(Material.GLASS).emissiveLighting { _, _, _ -> true }.luminance { _ -> 15 }.sounds(BlockSoundGroup.GLASS).nonOpaque().solidBlock { _, _, _ -> false }) {
override fun getRenderType(state: BlockState?) = BlockRenderType.MODEL
override fun isTranslucent(state: BlockState?, world: BlockView?, pos: BlockPos?) = true
override fun getAmbientOcclusionLightLevel(state: BlockState?, world: BlockView?, pos: BlockPos?) = 1f
override fun getCameraCollisionShape(state: BlockState?, world: BlockView?, pos: BlockPos?, context: ShapeContext?): VoxelShape = VoxelShapes.empty()
override fun getOutlineShape(state: BlockState?, view: BlockView?, pos: BlockPos?, context: ShapeContext?): VoxelShape = VoxelShapes.cuboid(4.0 / 16, 0.0, 4.0 / 16, 12.0 / 16, 10.0 / 16, 12.0 / 16)
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/miyucomics/hexical/registry/HexicalBlocks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package miyucomics.hexical.registry

import miyucomics.hexical.HexicalMain
import miyucomics.hexical.blocks.*
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap
import net.minecraft.block.entity.BlockEntityType
import net.minecraft.client.render.RenderLayer
import net.minecraft.util.registry.Registry

object HexicalBlocks {
Expand All @@ -20,4 +22,9 @@ object HexicalBlocks {
Registry.register(Registry.BLOCK_ENTITY_TYPE, HexicalMain.id("mage_block"), MAGE_BLOCK_ENTITY)
Registry.register(Registry.BLOCK, HexicalMain.id("media_jar"), MEDIA_JAR_BLOCK)
}

@JvmStatic
fun clientInit() {
BlockRenderLayerMap.INSTANCE.putBlock(MEDIA_JAR_BLOCK, RenderLayer.getTranslucent())
}
}

0 comments on commit 8d338df

Please sign in to comment.