[1.19] Allow custom outline rendering on EntityRenderers and BlockEntityRenderers (#8938)

This commit is contained in:
Dennis C authored and GitHub committed 2022-08-17 00:01:33 +02:00
1 parent 07254b36d7
commit 4e677a7558
4 files changed
+54 -1

No files matched your search

@@ -9,6 +9,7 @@ import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.network.Connection;
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
@@ -174,4 +175,15 @@ public interface IForgeBlockEntity extends ICapabilitySerializable<CompoundTag>
{
return ModelData.EMPTY;
}
/**
* Returns whether this {@link BlockEntity} has custom outline rendering behavior.
*
* @param player the local player currently viewing this {@code BlockEntity}
* @return {@code true} to enable outline processing
*/
default boolean hasCustomOutlineRendering(Player player)
{
return false;
}
}
@@ -12,6 +12,7 @@ import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.ai.attributes.AttributeInstance;
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.entity.Entity;
@@ -410,4 +411,17 @@ public interface IForgeEntity extends ICapabilitySerializable<CompoundTag>
{
return type.getSound(self(), action);
}
/**
* Returns whether this {@link Entity} has custom outline rendering behavior which does
* not use the existing automatic outline rendering based on {@link Entity#isCurrentlyGlowing()}
* and the entity's team color.
*
* @param player the local player currently viewing this {@code Entity}
* @return {@code true} to enable outline processing
*/
default boolean hasCustomOutlineRendering(Player player)
{
return false;
}
}