Skip to content

Commit

Permalink
feat: add primal membrane block for living mobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Elenterius committed Nov 29, 2023
1 parent 0af5924 commit a0ea6e8
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ private void addBlockTranslations() {
addBlock(ModBlocks.IMPERMEABLE_MEMBRANE, "Impermeable Membrane", "Gelatinous-like membrane reinforced with elastic fibers.");
addBlock(ModBlocks.BABY_PERMEABLE_MEMBRANE, "Baby-Permeable Membrane", "Gelatinous-like membrane reinforced with elastic fibers.\n\nBaby mobs can diffuse through the membrane.");
addBlock(ModBlocks.ADULT_PERMEABLE_MEMBRANE, "Adult-Permeable Membrane", "Gelatinous-like membrane reinforced with elastic fibers.\n\nAdult mobs can diffuse through the membrane.");
addBlock(ModBlocks.PRIMAL_PERMEABLE_MEMBRANE, "Primal Membrane", "Gelatinous-like membrane reinforced with elastic fibers.\n\nOnly mobs that are alive can diffuse through the membrane.");

addBlock(ModBlocks.PRIMAL_FLESH, "Primal Flesh Block", "Primitive and pure, you better not touch this with your dirty mitts.");
addBlock(ModBlocks.PRIMAL_FLESH_SLAB, "Primal Flesh Slab", "Primitive and pure, you better not touch this with your dirty mitts.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ protected void addTables() {
dropSelf(ModBlocks.IMPERMEABLE_MEMBRANE.get());
dropSelf(ModBlocks.BABY_PERMEABLE_MEMBRANE.get());
dropSelf(ModBlocks.ADULT_PERMEABLE_MEMBRANE.get());
dropSelf(ModBlocks.PRIMAL_PERMEABLE_MEMBRANE.get());
dropSelf(ModBlocks.FLESH_IRIS_DOOR.get());
dropSelf(ModBlocks.FLESH_FENCE.get());
dropSelf(ModBlocks.FLESH_FENCE_GATE.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ protected void registerStatesAndModels() {
translucentBlockWithItem(ModBlocks.IMPERMEABLE_MEMBRANE);
membraneWithItem(ModBlocks.BABY_PERMEABLE_MEMBRANE);
membraneWithItem(ModBlocks.ADULT_PERMEABLE_MEMBRANE);
membraneWithItem(ModBlocks.PRIMAL_PERMEABLE_MEMBRANE);
bioLantern(ModBlocks.YELLOW_BIO_LANTERN);
bioLantern(ModBlocks.BLUE_BIO_LANTERN);
bioLantern(ModBlocks.PRIMORDIAL_BIO_LANTERN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ protected void addTags() {
tag(BlockTags.IMPERMEABLE).add(
ModBlocks.IMPERMEABLE_MEMBRANE.get(),
ModBlocks.BABY_PERMEABLE_MEMBRANE.get(),
ModBlocks.ADULT_PERMEABLE_MEMBRANE.get()
ModBlocks.ADULT_PERMEABLE_MEMBRANE.get(),
ModBlocks.PRIMAL_PERMEABLE_MEMBRANE.get()
);
}

Expand Down
2 changes: 2 additions & 0 deletions src/generated/resources/assets/biomancy/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@
"block.biomancy.baby_permeable_membrane.tooltip": "Gelatinous-like membrane reinforced with elastic fibers.\n\nBaby mobs can diffuse through the membrane.",
"block.biomancy.adult_permeable_membrane": "Adult-Permeable Membrane",
"block.biomancy.adult_permeable_membrane.tooltip": "Gelatinous-like membrane reinforced with elastic fibers.\n\nAdult mobs can diffuse through the membrane.",
"block.biomancy.primal_permeable_membrane": "Primal Membrane",
"block.biomancy.primal_permeable_membrane.tooltip": "Gelatinous-like membrane reinforced with elastic fibers.\n\nOnly mobs that are alive can diffuse through the membrane.",
"block.biomancy.primal_flesh": "Primal Flesh Block",
"block.biomancy.primal_flesh.tooltip": "Primitive and pure, you better not touch this with your dirty mitts.",
"block.biomancy.primal_flesh_slab": "Primal Flesh Slab",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.MobType;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
Expand Down Expand Up @@ -73,6 +74,7 @@ public VoxelShape getCollisionShape(BlockState state, BlockGetter level, BlockPo
public interface IgnoreEntityCollisionPredicate {
IgnoreEntityCollisionPredicate IS_BABY_MOB = (state, level, pos, entity) -> entity instanceof LivingEntity livingEntity && livingEntity.isBaby();
IgnoreEntityCollisionPredicate IS_ADULT_MOB = (state, level, pos, entity) -> entity instanceof LivingEntity livingEntity && !livingEntity.isBaby();
IgnoreEntityCollisionPredicate IS_ALIVE_MOB = (state, level, pos, entity) -> entity instanceof LivingEntity livingEntity && livingEntity.getMobType() != MobType.UNDEAD;
IgnoreEntityCollisionPredicate IS_ITEM = (state, level, pos, entity) -> entity instanceof ItemEntity;
IgnoreEntityCollisionPredicate NEVER = (state, level, pos, entity) -> false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public final class ModBlocks {
public static final RegistryObject<MembraneBlock> IMPERMEABLE_MEMBRANE = registerMembrane("impermeable_membrane", MembraneBlock.IgnoreEntityCollisionPredicate.NEVER);
public static final RegistryObject<MembraneBlock> BABY_PERMEABLE_MEMBRANE = registerMembrane("baby_permeable_membrane", MembraneBlock.IgnoreEntityCollisionPredicate.IS_BABY_MOB);
public static final RegistryObject<MembraneBlock> ADULT_PERMEABLE_MEMBRANE = registerMembrane("adult_permeable_membrane", MembraneBlock.IgnoreEntityCollisionPredicate.IS_ADULT_MOB);
public static final RegistryObject<MembraneBlock> PRIMAL_PERMEABLE_MEMBRANE = registerMembrane("primal_permeable_membrane", MembraneBlock.IgnoreEntityCollisionPredicate.IS_ALIVE_MOB);

public static final RegistryObject<LadderBlock> FLESH_LADDER = register("flesh_ladder", () -> new LadderBlock(createFleshyBoneProperties().noOcclusion()));
public static final RegistryObject<FleshFenceBlock> FLESH_FENCE = register("flesh_fence", FleshFenceBlock::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public final class ModItems {
public static final RegistryObject<SimpleBlockItem> IMPERMEABLE_MEMBRANE = registerSimpleBlockItem(ModBlocks.IMPERMEABLE_MEMBRANE);
public static final RegistryObject<SimpleBlockItem> BABY_PERMEABLE_MEMBRANE = registerSimpleBlockItem(ModBlocks.BABY_PERMEABLE_MEMBRANE);
public static final RegistryObject<SimpleBlockItem> ADULT_PERMEABLE_MEMBRANE = registerSimpleBlockItem(ModBlocks.ADULT_PERMEABLE_MEMBRANE);
public static final RegistryObject<SimpleBlockItem> PRIMAL_PERMEABLE_MEMBRANE = registerSimpleBlockItem(ModBlocks.PRIMAL_PERMEABLE_MEMBRANE);
public static final RegistryObject<SimpleBlockItem> FLESH_LADDER = registerSimpleBlockItem(ModBlocks.FLESH_LADDER);
public static final RegistryObject<SimpleBlockItem> FLESH_FENCE = registerSimpleBlockItem(ModBlocks.FLESH_FENCE);
public static final RegistryObject<SimpleBlockItem> FLESH_FENCE_GATE = registerSimpleBlockItem(ModBlocks.FLESH_FENCE_GATE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,15 @@ public static void onItemColorRegistry(final RegisterColorHandlersEvent.Item eve
event.register((stack, tintIndex) -> ModItems.ESSENCE.get().getColor(stack, tintIndex), ModItems.ESSENCE.get());
event.register((stack, tintIndex) -> tintIndex == 1 ? 0xFF_09DF5B : 0xFF_FFFFFF, ModBlocks.BABY_PERMEABLE_MEMBRANE.get());
event.register((stack, tintIndex) -> tintIndex == 1 ? 0xFF_ACBF60 : 0xFF_FFFFFF, ModBlocks.ADULT_PERMEABLE_MEMBRANE.get());
event.register((stack, tintIndex) -> tintIndex == 1 ? 0xFF_F740FD : 0xFF_FFFFFF, ModBlocks.PRIMAL_PERMEABLE_MEMBRANE.get());
}

@SubscribeEvent
public static void onBlockColorRegistry(final RegisterColorHandlersEvent.Block event) {
event.register(VialHolderBlock::getTintColor, ModBlocks.VIAL_HOLDER.get());
event.register((state, level, pos, tintIndex) -> tintIndex == 1 ? 0xFF_09DF5B : 0xFF_FFFFFF, ModBlocks.BABY_PERMEABLE_MEMBRANE.get());
event.register((state, level, pos, tintIndex) -> tintIndex == 1 ? 0xFF_ACBF60 : 0xFF_FFFFFF, ModBlocks.ADULT_PERMEABLE_MEMBRANE.get());
event.register((state, level, pos, tintIndex) -> tintIndex == 1 ? 0xFF_F740FD : 0xFF_FFFFFF, ModBlocks.PRIMAL_PERMEABLE_MEMBRANE.get());
}

@SubscribeEvent
Expand Down

0 comments on commit a0ea6e8

Please sign in to comment.