Sealed records

- Convert IHaveCustomOverlayIcon into a sealed interface that is used through IHaveGoggleInformation or IHaveHoveringInformation
This commit is contained in:
IThundxr 2024-12-28 14:20:55 -05:00
parent 7795ee8191
commit ef7a05d5e6
Failed to generate hash of commit
3 changed files with 3 additions and 6 deletions

View file

@ -5,10 +5,7 @@ import com.simibubi.create.AllItems;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.entity.BlockEntity;
/**
* Implement this interface on the {@link BlockEntity} that wants to change the icon on the goggle overlay
*/
public interface IHaveCustomOverlayIcon {
public sealed interface IHaveCustomOverlayIcon permits IHaveGoggleInformation, IHaveHoveringInformation {
/**
* This method will be called when looking at a {@link BlockEntity} that implements this interface
* <p>

View file

@ -16,7 +16,7 @@ import net.minecraftforge.fluids.capability.IFluidHandler;
/**
* Implement this interface on the {@link BlockEntity} that wants to add info to the goggle overlay
*/
public interface IHaveGoggleInformation {
public non-sealed interface IHaveGoggleInformation extends IHaveCustomOverlayIcon {
/**
* This method will be called when looking at a {@link BlockEntity} that implements this interface
*

View file

@ -8,7 +8,7 @@ import net.minecraft.world.level.block.entity.BlockEntity;
/**
* Implement this interface on the {@link BlockEntity} that wants to add info to the goggle overlay
*/
public interface IHaveHoveringInformation {
public non-sealed interface IHaveHoveringInformation extends IHaveCustomOverlayIcon{
/**
* This method will be called when looking at a {@link BlockEntity} that implements this interface
*