This commit is contained in:
parent
7f813582c1
commit
57e1a1c40f
@ -11,8 +11,10 @@ import net.fabricmc.api.ClientModInitializer;
|
|||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
||||||
|
import net.fabricmc.fabric.api.event.player.AttackBlockCallback;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.render.RenderLayer;
|
import net.minecraft.client.render.RenderLayer;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public class EnergonRelicsClient implements ClientModInitializer {
|
public class EnergonRelicsClient implements ClientModInitializer {
|
||||||
@ -41,5 +43,13 @@ public class EnergonRelicsClient implements ClientModInitializer {
|
|||||||
BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.FORCEFIELD_BLOCK, RenderLayer.getTranslucent());
|
BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.FORCEFIELD_BLOCK, RenderLayer.getTranslucent());
|
||||||
|
|
||||||
AutoConfig.register(UserConfig.class, ReloadSerializer::new);
|
AutoConfig.register(UserConfig.class, ReloadSerializer::new);
|
||||||
|
|
||||||
|
AttackBlockCallback.EVENT.register((playerEntity, world, hand, blockPos, direction) -> {
|
||||||
|
if (world.getBlockState(blockPos).getBlock() == EnergonRelics.FORCEFIELD_BLOCK) {
|
||||||
|
return ActionResult.FAIL;
|
||||||
|
} else {
|
||||||
|
return ActionResult.PASS;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 491 B |
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
"#I#",
|
||||||
|
"IGI",
|
||||||
|
"#I#"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"#": {
|
||||||
|
"item": "energonrelics:circuit_board"
|
||||||
|
},
|
||||||
|
"I": {
|
||||||
|
"item": "minecraft:iron_ingot"
|
||||||
|
},
|
||||||
|
"G": {
|
||||||
|
"item": "minecraft:glowstone"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "energonrelics:forcefield_projector",
|
||||||
|
"count": 1
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user