File tree Expand file tree Collapse file tree
java/dev/dfonline/codeclient
assets/minecraft/models/block Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111import dev .dfonline .codeclient .location .Location ;
1212import dev .dfonline .codeclient .websocket .SocketHandler ;
1313import net .fabricmc .api .ModInitializer ;
14+ import net .fabricmc .fabric .api .blockrenderlayer .v1 .BlockRenderLayerMap ;
1415import net .fabricmc .fabric .api .client .command .v2 .ClientCommandRegistrationCallback ;
1516import net .fabricmc .fabric .api .client .keybinding .v1 .KeyBindingHelper ;
17+ import net .minecraft .block .Blocks ;
1618import net .minecraft .client .MinecraftClient ;
1719import net .minecraft .client .option .KeyBinding ;
20+ import net .minecraft .client .render .RenderLayer ;
1821import net .minecraft .client .util .InputUtil ;
1922import net .minecraft .network .Packet ;
2023import net .minecraft .network .listener .PacketListener ;
@@ -66,6 +69,7 @@ public static void onTick() {
6669
6770 @ Override
6871 public void onInitialize () {
72+ BlockRenderLayerMap .INSTANCE .putBlock (Blocks .BARRIER , RenderLayer .getTranslucent ());
6973
7074 try {
7175 SocketHandler .start ();
Original file line number Diff line number Diff line change 1+ package dev .dfonline .codeclient .mixin .block ;
2+
3+ import dev .dfonline .codeclient .CodeClient ;
4+ import dev .dfonline .codeclient .location .Build ;
5+ import dev .dfonline .codeclient .location .Dev ;
6+ import net .minecraft .block .BarrierBlock ;
7+ import net .minecraft .block .BlockRenderType ;
8+ import net .minecraft .block .BlockState ;
9+ import org .spongepowered .asm .mixin .Mixin ;
10+ import org .spongepowered .asm .mixin .injection .At ;
11+ import org .spongepowered .asm .mixin .injection .Inject ;
12+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfoReturnable ;
13+
14+ @ Mixin (BarrierBlock .class )
15+ public class MBarrier {
16+ @ Inject (method = "getRenderType" , at = @ At ("HEAD" ), cancellable = true )
17+ private void getRenderType (BlockState state , CallbackInfoReturnable <BlockRenderType > cir ) {
18+ if (CodeClient .location instanceof Dev || CodeClient .location instanceof Build )
19+ cir .setReturnValue (BlockRenderType .MODEL );
20+ }
21+ }
Original file line number Diff line number Diff line change 2121 "mixins" : [
2222 " ClientPlayerInteractionManagerAccessor" ,
2323 " MChunkRendererRegion" ,
24- " MWorld"
24+ " MWorld" ,
25+ " block.MBarrier"
2526 ]
2627}
Original file line number Diff line number Diff line change 1+ {
2+ "parent" : " minecraft:block/cube_all" ,
3+ "textures" : {
4+ "all" : " minecraft:item/barrier"
5+ }
6+ }
You can’t perform that action at this time.
0 commit comments