diff options
Diffstat (limited to 'src/main/java/gregtech/api/util')
| -rw-r--r-- | src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java b/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java index fdb4cbe7a4..3300ab43d6 100644 --- a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java +++ b/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java @@ -2,6 +2,7 @@ package gregtech.api.util; import static gregtech.api.enums.GT_Values.E; +import java.util.List; import java.util.function.Supplier; import javax.annotation.Nullable; @@ -16,6 +17,9 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; +import org.jetbrains.annotations.NotNull; + +import com.google.common.collect.ImmutableList; import com.gtnewhorizons.modularui.api.ModularUITextures; import com.gtnewhorizons.modularui.api.drawable.ItemDrawable; import com.gtnewhorizons.modularui.api.screen.ModularWindow; @@ -385,6 +389,19 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { ICoverable aTileEntity) { return getDropImpl(side, aCoverID, forceCast(aCoverVariable), aTileEntity); } + + /** + * Called when the cover is initially attached to a machine. + * + * @param player The attaching player + * @param aCover An {@link ItemStack} containing the cover + * @param aTileEntity The machine receiving the cover + * @param side Which side the cover is attached to + */ + public void onPlayerAttach(EntityPlayer player, ItemStack aCover, ICoverable aTileEntity, ForgeDirection side) { + // Do nothing by default. + } + // endregion // region UI stuff @@ -815,5 +832,24 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { public String trans(String aNr, String aEnglish) { return GT_Utility.trans(aNr, aEnglish); } + + public boolean allowsCopyPasteTool() { + return true; + } + + @NotNull + public final List<String> getAdditionalTooltip(ISerializableObject coverData) { + return getAdditionalTooltipImpl(forceCast(coverData)); + } + + /** + * Override to add to the tooltip generated when a user hovers over the cover on the left side of a machine's UI. + * + * @param coverData The cover data associated with the cover on a particular side. + * @return A list of new tooltip entries. Entries are inserted at the top, just after the name and direction line. + */ + protected List<String> getAdditionalTooltipImpl(T coverData) { + return ImmutableList.of(); + } // endregion } |
