Deprecate the StableAPI annotations, switch to JB annotations

This commit is contained in:
FalsePattern committed 2025-05-26 09:45:57 +02:00
1 parent 8645d20a16
commit df1f294776
96 files changed
+1079 -762

No files matched your search

@@ -21,7 +21,6 @@
*/
package com.falsepattern.lib.toasts;
import com.falsepattern.lib.StableAPI;
import com.falsepattern.lib.internal.impl.toast.GuiToastImpl;
import cpw.mods.fml.relauncher.Side;
@@ -30,20 +29,16 @@ import cpw.mods.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
@SideOnly(Side.CLIENT)
@StableAPI(since = "0.10.0")
public class GuiToast {
@Nullable
@StableAPI.Expose
public static <T extends IToast> T getToast(Class<? extends T> toastClass, Object type) {
return GuiToastImpl.getInstance().getToast(toastClass, type);
}
@StableAPI.Expose
public static void clear() {
GuiToastImpl.getInstance().clear();
}
@StableAPI.Expose
public static void add(IToast toastIn) {
GuiToastImpl.getInstance().add(toastIn);
}
@@ -21,7 +21,6 @@
*/
package com.falsepattern.lib.toasts;
import com.falsepattern.lib.StableAPI;
import com.falsepattern.lib.internal.Tags;
import com.falsepattern.lib.internal.impl.toast.GuiToastImpl;
@@ -32,27 +31,20 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
@StableAPI(since = "0.10.0")
public interface IToast {
@StableAPI.Expose
Object NO_TOKEN = new Object();
@StableAPI.Expose
Visibility draw(GuiToastImpl toastGui, long delta);
@StableAPI.Expose
int width();
@StableAPI.Expose
int height();
@StableAPI.Expose
default Object getType() {
return NO_TOKEN;
}
@SideOnly(Side.CLIENT)
@StableAPI(since = "0.10.0")
enum Visibility {
SHOW(new ResourceLocation(Tags.MODID, "ui.toast.in")),
HIDE(new ResourceLocation(Tags.MODID, "ui.toast.out"));
@@ -63,7 +55,6 @@ public interface IToast {
this.sound = soundIn;
}
@StableAPI.Expose
public void playSound(SoundHandler handler) {
handler.playSound(PositionedSoundRecord.func_147674_a(this.sound, 1.0F));
}
@@ -21,7 +21,6 @@
*/
package com.falsepattern.lib.toasts;
import com.falsepattern.lib.StableAPI;
import com.falsepattern.lib.internal.impl.toast.GuiToastImpl;
import com.falsepattern.lib.toasts.icon.ToastBG;
import com.falsepattern.lib.toasts.icon.ToastIcon;
@@ -38,7 +37,6 @@ import cpw.mods.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
@SideOnly(Side.CLIENT)
@StableAPI(since = "0.10.0")
public class SimpleToast implements IToast {
private final ToastBG background;
private final ToastIcon icon;
@@ -51,7 +49,6 @@ public class SimpleToast implements IToast {
private float displayedProgress;
private float currentProgress;
@StableAPI.Expose
public SimpleToast(@NonNull ToastBG background,
@Nullable ToastIcon icon, IChatComponent titleComponent,
@Nullable IChatComponent subtitleComponent, boolean drawProgressBar, long timeout) {
@@ -117,12 +114,10 @@ public class SimpleToast implements IToast {
return background.getIcon().getIconHeight();
}
@StableAPI.Expose
public void hide() {
visibility = IToast.Visibility.HIDE;
}
@StableAPI.Expose
public void setProgress(float progress) {
this.currentProgress = progress;
}
@@ -21,7 +21,6 @@
*/
package com.falsepattern.lib.toasts.icon;
import com.falsepattern.lib.StableAPI;
import com.falsepattern.lib.internal.Tags;
import lombok.NonNull;
import org.lwjgl.opengl.GL11;
@@ -34,40 +33,30 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
@StableAPI(since = "0.10.0")
public class ToastBG extends ToastTexture {
@StableAPI.Expose
public static final ToastBG TOAST_DARK =
new ToastBG(new ResourceLocation(Tags.MODID, "textures/gui/toast_dark.png"), 160, 32, 0xFFFFFFFF);
@StableAPI.Expose
public static final ToastBG TOAST_DARK_ROUNDED =
new ToastBG(new ResourceLocation(Tags.MODID, "textures/gui/toast_dark_rounded.png"), 160, 32, 0xFFFFFFFF);
@StableAPI.Expose
public static final ToastBG TOAST_NARRATOR =
new ToastBG(new ResourceLocation(Tags.MODID, "textures/gui/toast_narrator.png"), 160, 32, 0xFFAAAA00);
@StableAPI.Expose
public static final ToastBG TOAST_NARRATOR_ROUNDED =
new ToastBG(new ResourceLocation(Tags.MODID, "textures/gui/toast_narrator_rounded.png"),
160,
32,
0xFFAAAA00);
@StableAPI.Expose
public static final ToastBG TOAST_WHITE =
new ToastBG(new ResourceLocation(Tags.MODID, "textures/gui/toast_white.png"), 160, 32, 0xFF500050);
@StableAPI.Expose
public static final ToastBG TOAST_WHITE_ROUNDED =
new ToastBG(new ResourceLocation(Tags.MODID, "textures/gui/toast_white_rounded.png"), 160, 32, 0xFF500050);
@StableAPI.Expose
public final int defaultTextColor;
@StableAPI.Expose
public ToastBG(@NonNull ResourceLocation texture, int width, int height, int defaultTextColor) {
super(texture, width, height);
this.defaultTextColor = defaultTextColor;
}
@StableAPI.Expose
public ToastBG(@NonNull ResourceLocation texture, @NonNull IIcon icon, int defaultTextColor) {
super(texture, icon);
this.defaultTextColor = defaultTextColor;
@@ -21,7 +21,6 @@
*/
package com.falsepattern.lib.toasts.icon;
import com.falsepattern.lib.StableAPI;
import lombok.NonNull;
import org.lwjgl.opengl.GL11;
@@ -33,14 +32,11 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
@StableAPI(since = "0.10.0")
public class ToastIcon extends ToastTexture {
@StableAPI.Expose
public ToastIcon(@NonNull ResourceLocation texture, int width, int height) {
super(texture, width, height);
}
@StableAPI.Expose
public ToastIcon(@NonNull ResourceLocation texture, @NonNull IIcon icon) {
super(texture, icon);
}
@@ -21,7 +21,6 @@
*/
package com.falsepattern.lib.toasts.icon;
import com.falsepattern.lib.StableAPI;
import com.falsepattern.lib.util.RenderUtil;
import lombok.Getter;
import lombok.NonNull;
@@ -33,19 +32,16 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
@StableAPI(since = "0.10.0")
public abstract class ToastTexture {
@Getter(onMethod_ = @StableAPI.Expose)
@Getter
protected final IIcon icon;
@Getter(onMethod_ = @StableAPI.Expose)
@Getter
protected final ResourceLocation texture;
@StableAPI.Expose
public ToastTexture(@NonNull ResourceLocation texture, int width, int height) {
this(texture, RenderUtil.getFullTextureIcon(texture.toString(), width, height));
}
@StableAPI.Expose
public ToastTexture(@NonNull ResourceLocation texture, @NonNull IIcon icon) {
this.icon = icon;
this.texture = texture;
@@ -54,6 +50,5 @@ public abstract class ToastTexture {
/**
* Draws the icon at the specified position in the specified Gui
*/
@StableAPI.Expose
public abstract void draw(Gui guiIn, int x, int y);
}
@@ -0,0 +1,26 @@
/*
* This file is part of FalsePatternLib.
*
* Copyright (C) 2022-2025 FalsePattern
* All Rights Reserved
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* FalsePatternLib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* FalsePatternLib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with FalsePatternLib. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* @since 0.10.0
*/
package com.falsepattern.lib.toasts.icon;
@@ -0,0 +1,26 @@
/*
* This file is part of FalsePatternLib.
*
* Copyright (C) 2022-2025 FalsePattern
* All Rights Reserved
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* FalsePatternLib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* FalsePatternLib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with FalsePatternLib. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* @since 0.10.0
*/
package com.falsepattern.lib.toasts;