Improve Forcefields
EnergonRelics/pipeline/head This commit looks good Details

This commit is contained in:
TheBrokenRail 2020-07-23 19:50:10 -04:00
parent 7f813582c1
commit 57e1a1c40f
3 changed files with 33 additions and 0 deletions

View File

@ -11,8 +11,10 @@ import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
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.render.RenderLayer;
import net.minecraft.util.ActionResult;
@Environment(EnvType.CLIENT)
public class EnergonRelicsClient implements ClientModInitializer {
@ -41,5 +43,13 @@ public class EnergonRelicsClient implements ClientModInitializer {
BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.FORCEFIELD_BLOCK, RenderLayer.getTranslucent());
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

View File

@ -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
}
}