mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 02:55:17 +00:00
Seal most event hierarchies (#10515)
Most events in Forge are not designed to be extended by mod devs but technically allowed it before this PR, leading to a risk of unintentional breaking changes for those that do. If you need to extend a Forge event, please let us know so that we can explicitly support that and design it with extending in mind. Note that this change does not affect making your own events that directly extend from EventBus' `Event` class.
This commit is contained in:
1 parent
81f7f029c3
commit
504dcad849
174 files changed
+371
-371
No files matched your search
@@ -22,7 +22,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
**/
|
||||
@Cancelable
|
||||
public class ClientChatEvent extends Event
|
||||
public final class ClientChatEvent extends Event
|
||||
{
|
||||
private String message;
|
||||
private final String originalMessage;
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.UUID;
|
||||
* @see ChatType
|
||||
*/
|
||||
@Cancelable
|
||||
public class ClientChatReceivedEvent extends Event {
|
||||
public sealed class ClientChatReceivedEvent extends Event {
|
||||
private Component message;
|
||||
private final ChatType.Bound boundChatType;
|
||||
private final UUID sender;
|
||||
@@ -94,7 +94,7 @@ public class ClientChatReceivedEvent extends Event {
|
||||
*
|
||||
* @see ChatType
|
||||
*/
|
||||
public static class Player extends ClientChatReceivedEvent {
|
||||
public static final class Player extends ClientChatReceivedEvent {
|
||||
private final PlayerChatMessage playerChatMessage;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@@ -119,7 +119,7 @@ public class ClientChatReceivedEvent extends Event {
|
||||
* So moved to it's own event. {@link SystemMessageReceivedEvent}
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.21.1")
|
||||
public static class System extends ClientChatReceivedEvent {
|
||||
public static final class System extends ClientChatReceivedEvent {
|
||||
private final boolean overlay;
|
||||
|
||||
@ApiStatus.Internal
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraftforge.fml.LogicalSide;
|
||||
* @see ClientPauseChangeEvent.Pre
|
||||
* @see ClientPauseChangeEvent.Post
|
||||
*/
|
||||
public abstract class ClientPauseChangeEvent extends Event {
|
||||
public abstract sealed class ClientPauseChangeEvent extends Event {
|
||||
private final boolean pause;
|
||||
|
||||
public ClientPauseChangeEvent(boolean pause) {
|
||||
@@ -38,7 +38,7 @@ public abstract class ClientPauseChangeEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends ClientPauseChangeEvent {
|
||||
public static final class Pre extends ClientPauseChangeEvent {
|
||||
|
||||
public Pre(boolean pause) {
|
||||
super(pause);
|
||||
@@ -53,7 +53,7 @@ public abstract class ClientPauseChangeEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Post extends ClientPauseChangeEvent {
|
||||
public static final class Post extends ClientPauseChangeEvent {
|
||||
|
||||
public Post(boolean pause) {
|
||||
super(pause);
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class ClientPlayerChangeGameTypeEvent extends Event
|
||||
public final class ClientPlayerChangeGameTypeEvent extends Event
|
||||
{
|
||||
private final PlayerInfo info;
|
||||
private final GameType currentGameType;
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* @see LoggingOut
|
||||
* @see Clone
|
||||
**/
|
||||
public abstract class ClientPlayerNetworkEvent extends Event {
|
||||
public abstract sealed class ClientPlayerNetworkEvent extends Event {
|
||||
private final MultiPlayerGameMode multiPlayerGameMode;
|
||||
private final LocalPlayer player;
|
||||
private final Connection connection;
|
||||
@@ -67,7 +67,7 @@ public abstract class ClientPlayerNetworkEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class LoggingIn extends ClientPlayerNetworkEvent {
|
||||
public static final class LoggingIn extends ClientPlayerNetworkEvent {
|
||||
@ApiStatus.Internal
|
||||
public LoggingIn(final MultiPlayerGameMode controller, final LocalPlayer player, final Connection networkManager) {
|
||||
super(controller, player, networkManager);
|
||||
@@ -84,7 +84,7 @@ public abstract class ClientPlayerNetworkEvent extends Event {
|
||||
*/
|
||||
@SuppressWarnings("NullableProblems")
|
||||
// Shush IntelliJ, we override non-nullables as nullables in this specific event; see later comment
|
||||
public static class LoggingOut extends ClientPlayerNetworkEvent {
|
||||
public static final class LoggingOut extends ClientPlayerNetworkEvent {
|
||||
@ApiStatus.Internal
|
||||
public LoggingOut(@Nullable final MultiPlayerGameMode controller, @Nullable final LocalPlayer player, @Nullable final Connection networkManager) {
|
||||
//noinspection ConstantConditions we know these are nullable, but we don't want to annotate the super as nullable since this is the only event with nullables
|
||||
@@ -133,7 +133,7 @@ public abstract class ClientPlayerNetworkEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Clone extends ClientPlayerNetworkEvent {
|
||||
public static final class Clone extends ClientPlayerNetworkEvent {
|
||||
private final LocalPlayer oldPlayer;
|
||||
|
||||
@ApiStatus.Internal
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
*
|
||||
* @see ViewportEvent.ComputeFov
|
||||
*/
|
||||
public class ComputeFovModifierEvent extends Event {
|
||||
public final class ComputeFovModifierEvent extends Event {
|
||||
private final Player player;
|
||||
private final float fovModifier;
|
||||
private final float scale;
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* @see Render.Foreground
|
||||
* @see Render.Background
|
||||
*/
|
||||
public abstract class ContainerScreenEvent extends Event {
|
||||
public abstract sealed class ContainerScreenEvent extends Event {
|
||||
private final AbstractContainerScreen<?> containerScreen;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@@ -48,7 +48,7 @@ public abstract class ContainerScreenEvent extends Event {
|
||||
* @see Foreground
|
||||
* @see Background
|
||||
*/
|
||||
public static abstract class Render extends ContainerScreenEvent {
|
||||
public static abstract sealed class Render extends ContainerScreenEvent {
|
||||
private final GuiGraphics guiGraphics;
|
||||
private final int mouseX;
|
||||
private final int mouseY;
|
||||
@@ -94,7 +94,7 @@ public abstract class ContainerScreenEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Foreground extends Render {
|
||||
public static final class Foreground extends Render {
|
||||
@ApiStatus.Internal
|
||||
public Foreground(AbstractContainerScreen<?> guiContainer, GuiGraphics guiGraphics, int mouseX, int mouseY) {
|
||||
super(guiContainer, guiGraphics, mouseX, mouseY);
|
||||
@@ -110,7 +110,7 @@ public abstract class ContainerScreenEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Background extends Render {
|
||||
public static final class Background extends Render {
|
||||
@ApiStatus.Internal
|
||||
public Background(AbstractContainerScreen<?> guiContainer, GuiGraphics guiGraphics, int mouseX, int mouseY) {
|
||||
super(guiContainer, guiGraphics, mouseX, mouseY);
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.minecraft.client.renderer.special.SpecialModelRenderer;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
|
||||
public class CreateSpecialBlockRendererEvent extends Event {
|
||||
public final class CreateSpecialBlockRendererEvent extends Event {
|
||||
private final Map<Block, SpecialModelRenderer.Unbaked> map;
|
||||
|
||||
public CreateSpecialBlockRendererEvent(Map<Block, SpecialModelRenderer.Unbaked> map) {
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.List;
|
||||
* @see DebugText
|
||||
* @see Chat
|
||||
*/
|
||||
public abstract class CustomizeGuiOverlayEvent extends Event {
|
||||
public abstract sealed class CustomizeGuiOverlayEvent extends Event {
|
||||
private final Window window;
|
||||
private final GuiGraphics guiGraphics;
|
||||
private final float partialTick;
|
||||
@@ -57,7 +57,7 @@ public abstract class CustomizeGuiOverlayEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class BossEventProgress extends CustomizeGuiOverlayEvent {
|
||||
public static final class BossEventProgress extends CustomizeGuiOverlayEvent {
|
||||
private final LerpingBossEvent bossEvent;
|
||||
private final int x;
|
||||
private final int y;
|
||||
@@ -119,7 +119,7 @@ public abstract class CustomizeGuiOverlayEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class DebugText extends CustomizeGuiOverlayEvent {
|
||||
public static final class DebugText extends CustomizeGuiOverlayEvent {
|
||||
private final List<String> text;
|
||||
|
||||
private final Side side;
|
||||
@@ -159,7 +159,7 @@ public abstract class CustomizeGuiOverlayEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Chat extends CustomizeGuiOverlayEvent {
|
||||
public static final class Chat extends CustomizeGuiOverlayEvent {
|
||||
private int posX;
|
||||
private int posY;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ import java.util.function.Supplier;
|
||||
* @see EntityRenderersEvent.RegisterRenderers
|
||||
* @see EntityRenderersEvent.AddLayers
|
||||
*/
|
||||
public abstract class EntityRenderersEvent extends Event implements IModBusEvent {
|
||||
public abstract sealed class EntityRenderersEvent extends Event implements IModBusEvent {
|
||||
@ApiStatus.Internal
|
||||
protected EntityRenderersEvent() {}
|
||||
|
||||
@@ -65,7 +65,7 @@ public abstract class EntityRenderersEvent extends Event implements IModBusEvent
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class RegisterLayerDefinitions extends EntityRenderersEvent {
|
||||
public static final class RegisterLayerDefinitions extends EntityRenderersEvent {
|
||||
@ApiStatus.Internal
|
||||
public RegisterLayerDefinitions() {}
|
||||
|
||||
@@ -93,7 +93,7 @@ public abstract class EntityRenderersEvent extends Event implements IModBusEvent
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class RegisterRenderers extends EntityRenderersEvent {
|
||||
public static final class RegisterRenderers extends EntityRenderersEvent {
|
||||
@ApiStatus.Internal
|
||||
public RegisterRenderers() {}
|
||||
|
||||
@@ -127,7 +127,7 @@ public abstract class EntityRenderersEvent extends Event implements IModBusEvent
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class AddLayers extends EntityRenderersEvent {
|
||||
public static final class AddLayers extends EntityRenderersEvent {
|
||||
private final Map<EntityType<?>, EntityRenderer<?, ?>> renderers;
|
||||
private final Map<PlayerSkin.Model, EntityRenderer<? extends Player, ?>> skinMap;
|
||||
private final EntityRendererProvider.Context context;
|
||||
@@ -201,7 +201,7 @@ public abstract class EntityRenderersEvent extends Event implements IModBusEvent
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class CreateSkullModels extends EntityRenderersEvent {
|
||||
public static final class CreateSkullModels extends EntityRenderersEvent {
|
||||
private final ImmutableMap.Builder<Type, Function<EntityModelSet, SkullModelBase>> builder;
|
||||
|
||||
@ApiStatus.Internal
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.lwjgl.glfw.GLFW;
|
||||
* @see Key
|
||||
* @see InteractionKeyMappingTriggered
|
||||
*/
|
||||
public abstract class InputEvent extends Event {
|
||||
public abstract sealed class InputEvent extends Event {
|
||||
@ApiStatus.Internal
|
||||
protected InputEvent() {}
|
||||
|
||||
@@ -38,7 +38,7 @@ public abstract class InputEvent extends Event {
|
||||
* @see Pre
|
||||
* @see Post
|
||||
*/
|
||||
public static abstract class MouseButton extends InputEvent {
|
||||
public static abstract sealed class MouseButton extends InputEvent {
|
||||
private final int button;
|
||||
private final int action;
|
||||
private final int modifiers;
|
||||
@@ -97,7 +97,7 @@ public abstract class InputEvent extends Event {
|
||||
* @see <a href="https://www.glfw.org/docs/latest/input_guide.html#input_mouse_button" target="_top">the online GLFW documentation</a>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends MouseButton {
|
||||
public static final class Pre extends MouseButton {
|
||||
@ApiStatus.Internal
|
||||
public Pre(int button, int action, int modifiers) {
|
||||
super(button, action, modifiers);
|
||||
@@ -114,7 +114,7 @@ public abstract class InputEvent extends Event {
|
||||
*
|
||||
* @see <a href="https://www.glfw.org/docs/latest/input_guide.html#input_mouse_button" target="_top">the online GLFW documentation</a>
|
||||
*/
|
||||
public static class Post extends MouseButton {
|
||||
public static final class Post extends MouseButton {
|
||||
@ApiStatus.Internal
|
||||
public Post(int button, int action, int modifiers) {
|
||||
super(button, action, modifiers);
|
||||
@@ -135,7 +135,7 @@ public abstract class InputEvent extends Event {
|
||||
* @see <a href="https://www.glfw.org/docs/latest/input_guide.html#input_mouse_button" target="_top">the online GLFW documentation</a>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class MouseScrollingEvent extends InputEvent {
|
||||
public static final class MouseScrollingEvent extends InputEvent {
|
||||
private final double deltaX;
|
||||
private final double deltaY;
|
||||
private final double mouseX;
|
||||
@@ -213,7 +213,7 @@ public abstract class InputEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Key extends InputEvent {
|
||||
public static final class Key extends InputEvent {
|
||||
private final int key;
|
||||
private final int scanCode;
|
||||
private final int action;
|
||||
@@ -297,7 +297,7 @@ public abstract class InputEvent extends Event {
|
||||
*/
|
||||
// TODO: Change the 'button' to sub events. - Lex 0422202
|
||||
@Cancelable
|
||||
public static class InteractionKeyMappingTriggered extends InputEvent {
|
||||
public static final class InteractionKeyMappingTriggered extends InputEvent {
|
||||
private final int button;
|
||||
private final KeyMapping keyMapping;
|
||||
private final InteractionHand hand;
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.Map;
|
||||
/**
|
||||
* Houses events related to models.
|
||||
*/
|
||||
public abstract class ModelEvent extends Event {
|
||||
public abstract sealed class ModelEvent extends Event {
|
||||
@ApiStatus.Internal
|
||||
protected ModelEvent() { }
|
||||
|
||||
@@ -48,7 +48,7 @@ public abstract class ModelEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class ModifyBakingResult extends ModelEvent implements IModBusEvent {
|
||||
public static final class ModifyBakingResult extends ModelEvent implements IModBusEvent {
|
||||
private final ModelBakery modelBakery;
|
||||
private final ModelBakery.BakingResult results;
|
||||
|
||||
@@ -84,7 +84,7 @@ public abstract class ModelEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class BakingCompleted extends ModelEvent implements IModBusEvent {
|
||||
public static final class BakingCompleted extends ModelEvent implements IModBusEvent {
|
||||
private final ModelManager modelManager;
|
||||
private final ModelBakery modelBakery;
|
||||
|
||||
@@ -118,7 +118,7 @@ public abstract class ModelEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class RegisterModelStateDefinitions extends ModelEvent implements IModBusEvent {
|
||||
public static final class RegisterModelStateDefinitions extends ModelEvent implements IModBusEvent {
|
||||
private final Map<ResourceLocation, StateDefinition<Block, BlockState>> states = new HashMap<>();
|
||||
private final Map<ResourceLocation, StateDefinition<Block, BlockState>> view = Collections.unmodifiableMap(states);
|
||||
|
||||
@@ -148,7 +148,7 @@ public abstract class ModelEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class RegisterGeometryLoaders extends ModelEvent implements IModBusEvent {
|
||||
public static final class RegisterGeometryLoaders extends ModelEvent implements IModBusEvent {
|
||||
private final Map<ResourceLocation, IGeometryLoader> loaders;
|
||||
|
||||
@ApiStatus.Internal
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class MovementInputUpdateEvent extends PlayerEvent {
|
||||
public final class MovementInputUpdateEvent extends PlayerEvent {
|
||||
private final ClientInput input;
|
||||
|
||||
@ApiStatus.Internal
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class RecipesUpdatedEvent extends Event {
|
||||
public final class RecipesUpdatedEvent extends Event {
|
||||
private final ClientRecipeBook recipeBook;
|
||||
|
||||
@ApiStatus.Internal
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
*
|
||||
* @see net.minecraftforge.event.RegisterCommandsEvent
|
||||
*/
|
||||
public class RegisterClientCommandsEvent extends Event
|
||||
public final class RegisterClientCommandsEvent extends Event
|
||||
{
|
||||
private final CommandDispatcher<CommandSourceStack> dispatcher;
|
||||
private final CommandBuildContext context;
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class RegisterClientReloadListenersEvent extends Event implements IModBusEvent
|
||||
public final class RegisterClientReloadListenersEvent extends Event implements IModBusEvent
|
||||
{
|
||||
private final ReloadableResourceManager resourceManager;
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import java.util.function.Function;
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class RegisterClientTooltipComponentFactoriesEvent extends Event implements IModBusEvent
|
||||
public final class RegisterClientTooltipComponentFactoriesEvent extends Event implements IModBusEvent
|
||||
{
|
||||
private final Map<Class<? extends TooltipComponent>, Function<TooltipComponent, ClientTooltipComponent>> factories;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* @see RegisterColorHandlersEvent.Block
|
||||
* @see RegisterColorHandlersEvent.Item
|
||||
*/
|
||||
public abstract class RegisterColorHandlersEvent extends Event implements IModBusEvent {
|
||||
public abstract sealed class RegisterColorHandlersEvent extends Event implements IModBusEvent {
|
||||
@ApiStatus.Internal
|
||||
protected RegisterColorHandlersEvent() {}
|
||||
|
||||
@@ -39,7 +39,7 @@ public abstract class RegisterColorHandlersEvent extends Event implements IModBu
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Block extends RegisterColorHandlersEvent {
|
||||
public static final class Block extends RegisterColorHandlersEvent {
|
||||
private final BlockColors blockColors;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@@ -72,7 +72,7 @@ public abstract class RegisterColorHandlersEvent extends Event implements IModBu
|
||||
* Allows registration of custom {@link ColorResolver} implementations to be used with
|
||||
* {@link net.minecraft.world.level.BlockAndTintGetter#getBlockTint(BlockPos, ColorResolver)}.
|
||||
*/
|
||||
public static class ColorResolvers extends RegisterColorHandlersEvent {
|
||||
public static final class ColorResolvers extends RegisterColorHandlersEvent {
|
||||
private final ImmutableList.Builder<ColorResolver> builder;
|
||||
|
||||
@ApiStatus.Internal
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import java.util.Map;
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class RegisterDimensionSpecialEffectsEvent extends Event implements IModBusEvent
|
||||
public final class RegisterDimensionSpecialEffectsEvent extends Event implements IModBusEvent
|
||||
{
|
||||
private final Map<ResourceLocation, DimensionSpecialEffects> effects;
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import java.util.Map;
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class RegisterEntitySpectatorShadersEvent extends Event implements IModBusEvent
|
||||
public final class RegisterEntitySpectatorShadersEvent extends Event implements IModBusEvent
|
||||
{
|
||||
private final Map<EntityType<?>, ResourceLocation> shaders;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.Map;
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class RegisterItemDecorationsEvent extends Event implements IModBusEvent
|
||||
public final class RegisterItemDecorationsEvent extends Event implements IModBusEvent
|
||||
{
|
||||
|
||||
private final Map<Item, List<IItemDecorator>> decorators;
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class RegisterKeyMappingsEvent extends Event implements IModBusEvent
|
||||
public final class RegisterKeyMappingsEvent extends Event implements IModBusEvent
|
||||
{
|
||||
private final Options options;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.Map;
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class RegisterNamedRenderTypesEvent extends Event implements IModBusEvent
|
||||
public final class RegisterNamedRenderTypesEvent extends Event implements IModBusEvent
|
||||
{
|
||||
private final Map<ResourceLocation, RenderTypeGroup> renderTypes;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class RegisterParticleProvidersEvent extends Event implements IModBusEvent
|
||||
public final class RegisterParticleProvidersEvent extends Event implements IModBusEvent
|
||||
{
|
||||
private final ParticleEngine particleEngine;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class RegisterPresetEditorsEvent extends Event implements IModBusEvent
|
||||
public final class RegisterPresetEditorsEvent extends Event implements IModBusEvent
|
||||
{
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class RegisterTextureAtlasSpriteLoadersEvent extends Event implements IModBusEvent {
|
||||
public final class RegisterTextureAtlasSpriteLoadersEvent extends Event implements IModBusEvent {
|
||||
private final BiMap<ResourceLocation, ITextureAtlasSpriteLoader> loaders;
|
||||
|
||||
@ApiStatus.Internal
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public class RenderArmEvent extends Event {
|
||||
public final class RenderArmEvent extends Event {
|
||||
private final PoseStack poseStack;
|
||||
private final MultiBufferSource multiBufferSource;
|
||||
private final int packedLight;
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public class RenderBlockScreenEffectEvent extends Event
|
||||
public final class RenderBlockScreenEffectEvent extends Event
|
||||
{
|
||||
/**
|
||||
* The type of the block overlay to be rendered.
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* @see RenderArmEvent
|
||||
*/
|
||||
@Cancelable
|
||||
public class RenderHandEvent extends Event
|
||||
public final class RenderHandEvent extends Event
|
||||
{
|
||||
private final InteractionHand hand;
|
||||
private final PoseStack poseStack;
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* @see Entity
|
||||
*/
|
||||
@Cancelable
|
||||
public abstract class RenderHighlightEvent extends Event
|
||||
public abstract sealed class RenderHighlightEvent extends Event
|
||||
{
|
||||
private final LevelRenderer levelRenderer;
|
||||
private final Camera camera;
|
||||
@@ -104,7 +104,7 @@ public abstract class RenderHighlightEvent extends Event
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Block extends RenderHighlightEvent
|
||||
public static final class Block extends RenderHighlightEvent
|
||||
{
|
||||
@ApiStatus.Internal
|
||||
public Block(LevelRenderer levelRenderer, Camera camera, BlockHitResult target, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource)
|
||||
@@ -130,7 +130,7 @@ public abstract class RenderHighlightEvent extends Event
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Entity extends RenderHighlightEvent
|
||||
public static final class Entity extends RenderHighlightEvent
|
||||
{
|
||||
@ApiStatus.Internal
|
||||
public Entity(LevelRenderer levelRenderer, Camera camera, EntityHitResult target, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource)
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* @see ItemFrameRenderer
|
||||
*/
|
||||
@Cancelable
|
||||
public class RenderItemInFrameEvent extends Event {
|
||||
public final class RenderItemInFrameEvent extends Event {
|
||||
private final ItemFrameRenderState state;
|
||||
private final ItemFrameRenderer<?> renderer;
|
||||
private final PoseStack poseStack;
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* @see RenderPlayerEvent
|
||||
* @see LivingEntityRenderer
|
||||
*/
|
||||
public abstract class RenderLivingEvent<T extends LivingEntity, S extends LivingEntityRenderState, M extends EntityModel<? super S>> extends Event {
|
||||
public abstract sealed class RenderLivingEvent<T extends LivingEntity, S extends LivingEntityRenderState, M extends EntityModel<? super S>> extends Event {
|
||||
private final S state;
|
||||
private final LivingEntityRenderer<T, S, M> renderer;
|
||||
private final PoseStack poseStack;
|
||||
@@ -100,7 +100,7 @@ public abstract class RenderLivingEvent<T extends LivingEntity, S extends Living
|
||||
* @param <M> the model for the living entity
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre<T extends LivingEntity, S extends LivingEntityRenderState, M extends EntityModel<? super S>> extends RenderLivingEvent<T, S, M> {
|
||||
public static final class Pre<T extends LivingEntity, S extends LivingEntityRenderState, M extends EntityModel<? super S>> extends RenderLivingEvent<T, S, M> {
|
||||
@ApiStatus.Internal
|
||||
public Pre(S state, LivingEntityRenderer<T, S, M> renderer, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight) {
|
||||
super(state, renderer, poseStack, multiBufferSource, packedLight);
|
||||
@@ -118,7 +118,7 @@ public abstract class RenderLivingEvent<T extends LivingEntity, S extends Living
|
||||
* @param <T> the living entity that was rendered
|
||||
* @param <M> the model for the living entity
|
||||
*/
|
||||
public static class Post<T extends LivingEntity, S extends LivingEntityRenderState, M extends EntityModel<? super S>> extends RenderLivingEvent<T, S, M> {
|
||||
public static final class Post<T extends LivingEntity, S extends LivingEntityRenderState, M extends EntityModel<? super S>> extends RenderLivingEvent<T, S, M> {
|
||||
@ApiStatus.Internal
|
||||
public Post(S state, LivingEntityRenderer<T, S, M> renderer, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight) {
|
||||
super(state, renderer, poseStack, multiBufferSource, packedLight);
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* @see EntityRenderer
|
||||
*/
|
||||
@Event.HasResult
|
||||
public class RenderNameTagEvent extends Event {
|
||||
public final class RenderNameTagEvent extends Event {
|
||||
private Component nameplateContent;
|
||||
private final EntityRenderState state;
|
||||
private final Component originalContent;
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* @see RenderPlayerEvent.Post
|
||||
* @see PlayerRenderer
|
||||
*/
|
||||
public abstract class RenderPlayerEvent extends Event {
|
||||
public abstract sealed class RenderPlayerEvent extends Event {
|
||||
private final PlayerRenderState state;
|
||||
private final PlayerRenderer renderer;
|
||||
private final PoseStack poseStack;
|
||||
@@ -86,7 +86,7 @@ public abstract class RenderPlayerEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends RenderPlayerEvent {
|
||||
public static final class Pre extends RenderPlayerEvent {
|
||||
@ApiStatus.Internal
|
||||
public Pre(PlayerRenderState state, PlayerRenderer renderer, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight) {
|
||||
super(state, renderer, poseStack, multiBufferSource, packedLight);
|
||||
@@ -101,7 +101,7 @@ public abstract class RenderPlayerEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Post extends RenderPlayerEvent {
|
||||
public static final class Post extends RenderPlayerEvent {
|
||||
@ApiStatus.Internal
|
||||
public Post(PlayerRenderState state, PlayerRenderer renderer, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight) {
|
||||
super(state, renderer, poseStack, multiBufferSource, packedLight);
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.List;
|
||||
* @see RenderTooltipEvent.Pre
|
||||
* @see RenderTooltipEvent.Background
|
||||
*/
|
||||
public abstract class RenderTooltipEvent extends Event
|
||||
public abstract sealed class RenderTooltipEvent extends Event
|
||||
{
|
||||
@NotNull
|
||||
protected final ItemStack itemStack;
|
||||
@@ -121,7 +121,7 @@ public abstract class RenderTooltipEvent extends Event
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class GatherComponents extends Event
|
||||
public static final class GatherComponents extends Event
|
||||
{
|
||||
private final ItemStack itemStack;
|
||||
private final int screenWidth;
|
||||
@@ -210,7 +210,7 @@ public abstract class RenderTooltipEvent extends Event
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends RenderTooltipEvent
|
||||
public static final class Pre extends RenderTooltipEvent
|
||||
{
|
||||
private final int screenWidth;
|
||||
private final int screenHeight;
|
||||
@@ -289,7 +289,7 @@ public abstract class RenderTooltipEvent extends Event
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Background extends RenderTooltipEvent {
|
||||
public static final class Background extends RenderTooltipEvent {
|
||||
private final ResourceLocation originalBackground;
|
||||
private ResourceLocation background;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.function.Consumer;
|
||||
* @see MouseInput
|
||||
* @see KeyInput
|
||||
*/
|
||||
public abstract class ScreenEvent extends Event {
|
||||
public abstract sealed class ScreenEvent extends Event {
|
||||
private final Screen screen;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@@ -61,7 +61,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* @see Init.Pre
|
||||
* @see Init.Post
|
||||
*/
|
||||
public static abstract class Init extends ScreenEvent {
|
||||
public static abstract sealed class Init extends ScreenEvent {
|
||||
private final Consumer<GuiEventListener> add;
|
||||
private final Consumer<GuiEventListener> remove;
|
||||
|
||||
@@ -111,7 +111,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends Init {
|
||||
public static final class Pre extends Init {
|
||||
@ApiStatus.Internal
|
||||
public Pre(Screen screen, List<GuiEventListener> list, Consumer<GuiEventListener> add, Consumer<GuiEventListener> remove) {
|
||||
super(screen, list, add, remove);
|
||||
@@ -126,7 +126,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Post extends Init {
|
||||
public static final class Post extends Init {
|
||||
@ApiStatus.Internal
|
||||
public Post(Screen screen, List<GuiEventListener> list, Consumer<GuiEventListener> add, Consumer<GuiEventListener> remove) {
|
||||
super(screen, list, add, remove);
|
||||
@@ -141,7 +141,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* @see Render.Pre
|
||||
* @see Render.Post
|
||||
*/
|
||||
public static abstract class Render extends ScreenEvent {
|
||||
public static abstract sealed class Render extends ScreenEvent {
|
||||
private final GuiGraphics guiGraphics;
|
||||
private final int mouseX;
|
||||
private final int mouseY;
|
||||
@@ -194,7 +194,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends Render {
|
||||
public static final class Pre extends Render {
|
||||
@ApiStatus.Internal
|
||||
public Pre(Screen screen, GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) {
|
||||
super(screen, guiGraphics, mouseX, mouseY, partialTick);
|
||||
@@ -209,7 +209,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Post extends Render {
|
||||
public static final class Post extends Render {
|
||||
@ApiStatus.Internal
|
||||
public Post(Screen screen, GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) {
|
||||
super(screen, guiGraphics, mouseX, mouseY, partialTick);
|
||||
@@ -226,7 +226,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class BackgroundRendered extends ScreenEvent {
|
||||
public static final class BackgroundRendered extends ScreenEvent {
|
||||
private final GuiGraphics guiGraphics;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@@ -255,7 +255,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class RenderInventoryMobEffects extends ScreenEvent {
|
||||
public static final class RenderInventoryMobEffects extends ScreenEvent {
|
||||
private final int availableSpace;
|
||||
private boolean compact;
|
||||
private int horizontalOffset;
|
||||
@@ -320,7 +320,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* @see MouseDragged
|
||||
* @see MouseScrolled
|
||||
*/
|
||||
private static abstract class MouseInput extends ScreenEvent {
|
||||
private static abstract sealed class MouseInput extends ScreenEvent {
|
||||
private final double mouseX;
|
||||
private final double mouseY;
|
||||
|
||||
@@ -353,7 +353,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* @see MouseButtonPressed.Pre
|
||||
* @see MouseButtonPressed.Post
|
||||
*/
|
||||
public static abstract class MouseButtonPressed extends MouseInput {
|
||||
public static abstract sealed class MouseButtonPressed extends MouseInput {
|
||||
private final int button;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@@ -383,7 +383,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends MouseButtonPressed {
|
||||
public static final class Pre extends MouseButtonPressed {
|
||||
@ApiStatus.Internal
|
||||
public Pre(Screen screen, double mouseX, double mouseY, int button) {
|
||||
super(screen, mouseX, mouseY, button);
|
||||
@@ -406,7 +406,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@HasResult
|
||||
public static class Post extends MouseButtonPressed {
|
||||
public static final class Post extends MouseButtonPressed {
|
||||
private final boolean handled;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@@ -431,7 +431,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* @see MouseButtonReleased.Pre
|
||||
* @see MouseButtonReleased.Post
|
||||
*/
|
||||
public static abstract class MouseButtonReleased extends MouseInput {
|
||||
public static abstract sealed class MouseButtonReleased extends MouseInput {
|
||||
private final int button;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@@ -461,7 +461,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends MouseButtonReleased {
|
||||
public static final class Pre extends MouseButtonReleased {
|
||||
@ApiStatus.Internal
|
||||
public Pre(Screen screen, double mouseX, double mouseY, int button) {
|
||||
super(screen, mouseX, mouseY, button);
|
||||
@@ -484,7 +484,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@HasResult
|
||||
public static class Post extends MouseButtonReleased {
|
||||
public static final class Post extends MouseButtonReleased {
|
||||
private final boolean handled;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@@ -509,7 +509,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* @see MouseDragged.Pre
|
||||
* @see MouseDragged.Post
|
||||
*/
|
||||
public static abstract class MouseDragged extends MouseInput {
|
||||
public static abstract sealed class MouseDragged extends MouseInput {
|
||||
private final int mouseButton;
|
||||
private final double dragX;
|
||||
private final double dragY;
|
||||
@@ -557,7 +557,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends MouseDragged {
|
||||
public static final class Pre extends MouseDragged {
|
||||
@ApiStatus.Internal
|
||||
public Pre(Screen screen, double mouseX, double mouseY, int mouseButton, double dragX, double dragY) {
|
||||
super(screen, mouseX, mouseY, mouseButton, dragX, dragY);
|
||||
@@ -574,7 +574,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Post extends MouseDragged {
|
||||
public static final class Post extends MouseDragged {
|
||||
@ApiStatus.Internal
|
||||
public Post(Screen screen, double mouseX, double mouseY, int mouseButton, double dragX, double dragY) {
|
||||
super(screen, mouseX, mouseY, mouseButton, dragX, dragY);
|
||||
@@ -589,7 +589,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* @see MouseScrolled.Pre
|
||||
* @see MouseScrolled.Post
|
||||
*/
|
||||
public static abstract class MouseScrolled extends MouseInput {
|
||||
public static abstract sealed class MouseScrolled extends MouseInput {
|
||||
private final double deltaX;
|
||||
private final double deltaY;
|
||||
|
||||
@@ -625,7 +625,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends MouseScrolled {
|
||||
public static final class Pre extends MouseScrolled {
|
||||
@ApiStatus.Internal
|
||||
public Pre(Screen screen, double mouseX, double mouseY, double deltaX, double deltaY) {
|
||||
super(screen, mouseX, mouseY, deltaX, deltaY);
|
||||
@@ -642,7 +642,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Post extends MouseScrolled {
|
||||
public static final class Post extends MouseScrolled {
|
||||
@ApiStatus.Internal
|
||||
public Post(Screen screen, double mouseX, double mouseY, double deltaX, double deltaY) {
|
||||
super(screen, mouseX, mouseY, deltaX, deltaY);
|
||||
@@ -659,7 +659,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* @see InputConstants
|
||||
* @see <a href="https://www.glfw.org/docs/latest/input_guide.html#input_key" target="_top">the online GLFW documentation</a>
|
||||
*/
|
||||
private static abstract class KeyInput extends ScreenEvent {
|
||||
private static abstract sealed class KeyInput extends ScreenEvent {
|
||||
private final int keyCode;
|
||||
private final int scanCode;
|
||||
private final int modifiers;
|
||||
@@ -719,7 +719,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* @see KeyPressed.Pre
|
||||
* @see KeyPressed.Post
|
||||
*/
|
||||
public static abstract class KeyPressed extends KeyInput {
|
||||
public static abstract sealed class KeyPressed extends KeyInput {
|
||||
@ApiStatus.Internal
|
||||
public KeyPressed(Screen screen, int keyCode, int scanCode, int modifiers) {
|
||||
super(screen, keyCode, scanCode, modifiers);
|
||||
@@ -736,7 +736,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends KeyPressed {
|
||||
public static final class Pre extends KeyPressed {
|
||||
@ApiStatus.Internal
|
||||
public Pre(Screen screen, int keyCode, int scanCode, int modifiers) {
|
||||
super(screen, keyCode, scanCode, modifiers);
|
||||
@@ -754,7 +754,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Post extends KeyPressed {
|
||||
public static final class Post extends KeyPressed {
|
||||
@ApiStatus.Internal
|
||||
public Post(Screen screen, int keyCode, int scanCode, int modifiers) {
|
||||
super(screen, keyCode, scanCode, modifiers);
|
||||
@@ -769,7 +769,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* @see KeyReleased.Pre
|
||||
* @see KeyReleased.Post
|
||||
*/
|
||||
public static abstract class KeyReleased extends KeyInput {
|
||||
public static abstract sealed class KeyReleased extends KeyInput {
|
||||
@ApiStatus.Internal
|
||||
public KeyReleased(Screen screen, int keyCode, int scanCode, int modifiers) {
|
||||
super(screen, keyCode, scanCode, modifiers);
|
||||
@@ -786,7 +786,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends KeyReleased {
|
||||
public static final class Pre extends KeyReleased {
|
||||
@ApiStatus.Internal
|
||||
public Pre(Screen screen, int keyCode, int scanCode, int modifiers) {
|
||||
super(screen, keyCode, scanCode, modifiers);
|
||||
@@ -804,7 +804,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Post extends KeyReleased {
|
||||
public static final class Post extends KeyReleased {
|
||||
@ApiStatus.Internal
|
||||
public Post(Screen screen, int keyCode, int scanCode, int modifiers) {
|
||||
super(screen, keyCode, scanCode, modifiers);
|
||||
@@ -820,7 +820,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* @see CharacterTyped.Post
|
||||
* @see <a href="https://www.glfw.org/docs/latest/input_guide.html#input_char" target="_top">the online GLFW documentation</a>
|
||||
*/
|
||||
public static class CharacterTyped extends ScreenEvent {
|
||||
public static sealed class CharacterTyped extends ScreenEvent {
|
||||
private final char codePoint;
|
||||
private final int modifiers;
|
||||
|
||||
@@ -864,7 +864,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends CharacterTyped {
|
||||
public static final class Pre extends CharacterTyped {
|
||||
@ApiStatus.Internal
|
||||
public Pre(Screen screen, char codePoint, int modifiers) {
|
||||
super(screen, codePoint, modifiers);
|
||||
@@ -881,7 +881,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Post extends CharacterTyped {
|
||||
public static final class Post extends CharacterTyped {
|
||||
@ApiStatus.Internal
|
||||
public Post(Screen screen, char codePoint, int modifiers) {
|
||||
super(screen, codePoint, modifiers);
|
||||
@@ -902,7 +902,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Opening extends ScreenEvent {
|
||||
public static final class Opening extends ScreenEvent {
|
||||
@Nullable
|
||||
private final Screen currentScreen;
|
||||
private Screen newScreen;
|
||||
@@ -949,7 +949,7 @@ public abstract class ScreenEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Closing extends ScreenEvent {
|
||||
public static final class Closing extends ScreenEvent {
|
||||
@ApiStatus.Internal
|
||||
public Closing(Screen screen) {
|
||||
super(screen);
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.io.IOException;
|
||||
* @see Screenshot
|
||||
*/
|
||||
@Cancelable
|
||||
public class ScreenshotEvent extends Event {
|
||||
public final class ScreenshotEvent extends Event {
|
||||
public static final Component DEFAULT_CANCEL_REASON = Component.literal("Screenshot canceled");
|
||||
|
||||
private final NativeImage image;
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
*
|
||||
*/
|
||||
@Cancelable
|
||||
public class SystemMessageReceivedEvent extends Event {
|
||||
public final class SystemMessageReceivedEvent extends Event {
|
||||
private Component message;
|
||||
private final boolean overlay;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* @see TextureStitchEvent.Post
|
||||
* @see TextureAtlas
|
||||
*/
|
||||
public class TextureStitchEvent extends Event implements IModBusEvent
|
||||
public sealed class TextureStitchEvent extends Event implements IModBusEvent
|
||||
{
|
||||
private final TextureAtlas atlas;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class TextureStitchEvent extends Event implements IModBusEvent
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus()} mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class Post extends TextureStitchEvent
|
||||
public static final class Post extends TextureStitchEvent
|
||||
{
|
||||
@ApiStatus.Internal
|
||||
public Post(TextureAtlas map)
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraftforge.fml.LogicalSide;
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public class ToastAddEvent extends Event {
|
||||
public final class ToastAddEvent extends Event {
|
||||
private final Toast toast;
|
||||
|
||||
public ToastAddEvent(Toast toast) {
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* @see ComputeCameraAngles
|
||||
* @see ComputeFov
|
||||
*/
|
||||
public abstract class ViewportEvent extends Event {
|
||||
public abstract sealed class ViewportEvent extends Event {
|
||||
private final GameRenderer renderer;
|
||||
private final Camera camera;
|
||||
private final double partialTick;
|
||||
@@ -73,7 +73,7 @@ public abstract class ViewportEvent extends Event {
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class RenderFog extends ViewportEvent {
|
||||
public static final class RenderFog extends ViewportEvent {
|
||||
private final FogMode mode;
|
||||
private final FogType type;
|
||||
private float farPlaneDistance;
|
||||
@@ -182,7 +182,7 @@ public abstract class ViewportEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class ComputeFogColor extends ViewportEvent {
|
||||
public static final class ComputeFogColor extends ViewportEvent {
|
||||
private float red;
|
||||
private float green;
|
||||
private float blue;
|
||||
@@ -254,7 +254,7 @@ public abstract class ViewportEvent extends Event {
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public static class ComputeCameraAngles extends ViewportEvent {
|
||||
public static final class ComputeCameraAngles extends ViewportEvent {
|
||||
private float yaw;
|
||||
private float pitch;
|
||||
private float roll;
|
||||
@@ -327,7 +327,7 @@ public abstract class ViewportEvent extends Event {
|
||||
*
|
||||
* @see ComputeFovModifierEvent
|
||||
*/
|
||||
public static class ComputeFov extends ViewportEvent {
|
||||
public static final class ComputeFov extends ViewportEvent {
|
||||
private final boolean usedConfiguredFov;
|
||||
private float fov;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* @see PlaySoundSourceEvent
|
||||
* @see PlayStreamingSourceEvent
|
||||
*/
|
||||
public class PlaySoundEvent extends SoundEvent
|
||||
public final class PlaySoundEvent extends SoundEvent
|
||||
{
|
||||
private final String name;
|
||||
private final SoundInstance originalSound;
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
*
|
||||
* @see PlayStreamingSourceEvent
|
||||
*/
|
||||
public class PlaySoundSourceEvent extends SoundSourceEvent
|
||||
public final class PlaySoundSourceEvent extends SoundSourceEvent
|
||||
{
|
||||
@ApiStatus.Internal
|
||||
public PlaySoundSourceEvent(SoundEngine engine, SoundInstance sound, Channel channel)
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
*
|
||||
* @see PlayStreamingSourceEvent
|
||||
*/
|
||||
public class PlayStreamingSourceEvent extends SoundSourceEvent
|
||||
public final class PlayStreamingSourceEvent extends SoundSourceEvent
|
||||
{
|
||||
@ApiStatus.Internal
|
||||
public PlayStreamingSourceEvent(SoundEngine engine, SoundInstance sound, Channel channel)
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
*/
|
||||
public class SoundEngineLoadEvent extends SoundEvent implements IModBusEvent
|
||||
public final class SoundEngineLoadEvent extends SoundEvent implements IModBusEvent
|
||||
{
|
||||
@ApiStatus.Internal
|
||||
public SoundEngineLoadEvent(SoundEngine manager)
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class GatherDataEvent extends Event implements IModBusEvent
|
||||
public final class GatherDataEvent extends Event implements IModBusEvent
|
||||
{
|
||||
private final DataGenerator dataGenerator;
|
||||
private final DataGeneratorConfig config;
|
||||
@@ -54,7 +54,7 @@ public class GatherDataEvent extends Event implements IModBusEvent
|
||||
public boolean includeReports() { return this.config.reports; }
|
||||
public boolean validate() { return this.config.validate; }
|
||||
|
||||
public static class DataGeneratorConfig {
|
||||
public static final class DataGeneratorConfig {
|
||||
private final Set<String> mods;
|
||||
private final Path path;
|
||||
private final Collection<Path> inputs;
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.function.Consumer;
|
||||
/**
|
||||
* Fired on {@link PackRepository} creation to allow mods to add new pack finders.
|
||||
*/
|
||||
public class AddPackFindersEvent extends Event implements IModBusEvent {
|
||||
public final class AddPackFindersEvent extends Event implements IModBusEvent {
|
||||
private final PackType packType;
|
||||
private final Consumer<RepositorySource> sources;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.concurrent.Executor;
|
||||
* The event is fired on each reload and lets modders add their own ReloadListeners, for server-side resources.
|
||||
* The event is fired on the {@link MinecraftForge#EVENT_BUS}
|
||||
*/
|
||||
public class AddReloadListenerEvent extends Event {
|
||||
public final class AddReloadListenerEvent extends Event {
|
||||
private final List<PreparableReloadListener> listeners = new ArrayList<>();
|
||||
private final ReloadableServerResources serverResources;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* if the output is empty, and the event is not canceled, vanilla behavior will execute. <br>
|
||||
*/
|
||||
@Cancelable
|
||||
public class AnvilUpdateEvent extends Event {
|
||||
public final class AnvilUpdateEvent extends Event {
|
||||
private final ItemStack left;
|
||||
private final ItemStack right;
|
||||
private final String name;
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* only on the {@linkplain LogicalSide#SERVER logical server}.
|
||||
**/
|
||||
@Cancelable
|
||||
public class CommandEvent extends Event
|
||||
public final class CommandEvent extends Event
|
||||
{
|
||||
private ParseResults<CommandSourceStack> parse;
|
||||
@Nullable
|
||||
|
||||
@@ -19,7 +19,7 @@ import net.minecraftforge.eventbus.api.Event;
|
||||
* <br>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
**/
|
||||
public class DifficultyChangeEvent extends Event {
|
||||
public final class DifficultyChangeEvent extends Event {
|
||||
private final Difficulty difficulty;
|
||||
private final Difficulty oldDifficulty;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraftforge.eventbus.api.Event;
|
||||
*
|
||||
* @author Curle
|
||||
*/
|
||||
public class GameShuttingDownEvent extends Event
|
||||
public final class GameShuttingDownEvent extends Event
|
||||
{
|
||||
public GameShuttingDownEvent() {}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import javax.annotation.Nullable;
|
||||
Where all the events fore Gathering Components will exist.
|
||||
*/
|
||||
|
||||
public abstract class GatherComponentsEvent extends Event {
|
||||
public abstract sealed class GatherComponentsEvent extends Event {
|
||||
private final DataComponentMap.Builder components = DataComponentMap.builder();
|
||||
private final DataComponentMap originalComponents;
|
||||
private final Object owner;
|
||||
@@ -54,7 +54,7 @@ public abstract class GatherComponentsEvent extends Event {
|
||||
*
|
||||
* References in {@link net.minecraft.world.item.Items} may not be valid at the current time.
|
||||
*/
|
||||
public static class Item extends GatherComponentsEvent {
|
||||
public static final class Item extends GatherComponentsEvent {
|
||||
public Item(net.minecraft.world.item.Item item, DataComponentMap dataComponents) {
|
||||
super(item, dataComponents);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
|
||||
public abstract class GrindstoneEvent extends Event
|
||||
public abstract sealed class GrindstoneEvent extends Event
|
||||
{
|
||||
private final ItemStack top;
|
||||
private final ItemStack bottom;
|
||||
@@ -79,7 +79,7 @@ public abstract class GrindstoneEvent extends Event
|
||||
* </ul>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class OnPlaceItem extends GrindstoneEvent
|
||||
public static final class OnPlaceItem extends GrindstoneEvent
|
||||
{
|
||||
private ItemStack output;
|
||||
|
||||
@@ -119,7 +119,7 @@ public abstract class GrindstoneEvent extends Event
|
||||
* if the amount of experience is larger than or equal 0, the vanilla behavior for calculating experience will not run. <br>
|
||||
*/
|
||||
@Cancelable
|
||||
public static class OnTakeItem extends GrindstoneEvent
|
||||
public static final class OnTakeItem extends GrindstoneEvent
|
||||
{
|
||||
private ItemStack newTop = ItemStack.EMPTY;
|
||||
private ItemStack newBottom = ItemStack.EMPTY;
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* This also means that the two vanilla checks described above will not be called.
|
||||
*/
|
||||
@Cancelable
|
||||
public class ItemStackedOnOtherEvent extends Event
|
||||
public final class ItemStackedOnOtherEvent extends Event
|
||||
{
|
||||
private final ItemStack carriedItem;
|
||||
private final ItemStack stackedOnItem;
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraftforge.fml.LogicalSide;
|
||||
* only on the {@linkplain LogicalSide#SERVER logical server}.</p>
|
||||
*/
|
||||
@Cancelable
|
||||
public class LootTableLoadEvent extends Event
|
||||
public final class LootTableLoadEvent extends Event
|
||||
{
|
||||
private final ResourceLocation name;
|
||||
private LootTable table;
|
||||
|
||||
@@ -39,7 +39,7 @@ import java.util.stream.Stream;
|
||||
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
|
||||
* on both {@linkplain LogicalSide logical sides}.</p>
|
||||
*/
|
||||
public class ModMismatchEvent extends Event implements IModBusEvent
|
||||
public final class ModMismatchEvent extends Event implements IModBusEvent
|
||||
{
|
||||
/**
|
||||
* The level being loaded. Useful for things like {@link net.minecraft.world.level.storage.DimensionDataStorage}
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.List;
|
||||
* before tags and crafting recipes are sent to the client. Send datapack data
|
||||
* to clients when this event fires.
|
||||
*/
|
||||
public class OnDatapackSyncEvent extends Event {
|
||||
public final class OnDatapackSyncEvent extends Event {
|
||||
private final PlayerList playerList;
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -38,7 +38,7 @@ import java.util.Objects;
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
*/
|
||||
@Cancelable
|
||||
public class PlayLevelSoundEvent extends Event {
|
||||
public sealed class PlayLevelSoundEvent extends Event {
|
||||
private final Level level;
|
||||
private final float originalVolume;
|
||||
private final float originalPitch;
|
||||
@@ -149,7 +149,7 @@ public class PlayLevelSoundEvent extends Event {
|
||||
* <p>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
*/
|
||||
public static class AtEntity extends PlayLevelSoundEvent {
|
||||
public static final class AtEntity extends PlayLevelSoundEvent {
|
||||
private final Entity entity;
|
||||
|
||||
public AtEntity(Level level, @Nullable Entity entity, Holder<SoundEvent> sound, SoundSource source, float volume, float pitch) {
|
||||
@@ -176,7 +176,7 @@ public class PlayLevelSoundEvent extends Event {
|
||||
* <p>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
*/
|
||||
public static class AtPosition extends PlayLevelSoundEvent {
|
||||
public static final class AtPosition extends PlayLevelSoundEvent {
|
||||
private final Vec3 position;
|
||||
|
||||
public AtPosition(Level level, Vec3 position, Holder<SoundEvent> sound, SoundSource source, float volume, float pitch) {
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.commands.Commands;
|
||||
*
|
||||
* The event is fired on the {@link MinecraftForge#EVENT_BUS}
|
||||
*/
|
||||
public class RegisterCommandsEvent extends Event
|
||||
public final class RegisterCommandsEvent extends Event
|
||||
{
|
||||
private final CommandDispatcher<CommandSourceStack> dispatcher;
|
||||
private final Commands.CommandSelection environment;
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.google.common.base.Preconditions;
|
||||
* @see StructuresBecomeConfiguredFix
|
||||
* @see #register(String, StructuresBecomeConfiguredFix.Conversion)
|
||||
*/
|
||||
public class RegisterStructureConversionsEvent extends Event
|
||||
public final class RegisterStructureConversionsEvent extends Event
|
||||
{
|
||||
private final Map<String, StructuresBecomeConfiguredFix.Conversion> map;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* only on the {@linkplain LogicalSide#SERVER logical server}.
|
||||
**/
|
||||
@Cancelable
|
||||
public class ServerChatEvent extends Event {
|
||||
public final class ServerChatEvent extends Event {
|
||||
private final ServerPlayer player;
|
||||
private final String username;
|
||||
private final String rawText;
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.minecraftforge.eventbus.api.Event;
|
||||
/**
|
||||
* Fired when tags are updated on either server or client. This event can be used to refresh data that depends on tags.
|
||||
*/
|
||||
public class TagsUpdatedEvent extends Event
|
||||
public final class TagsUpdatedEvent extends Event
|
||||
{
|
||||
private final RegistryAccess registryAccess;
|
||||
private final UpdateCause updateCause;
|
||||
|
||||
@@ -16,13 +16,13 @@ import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
|
||||
public class TickEvent extends Event {
|
||||
public sealed class TickEvent extends Event {
|
||||
public enum Type {
|
||||
LEVEL, PLAYER, CLIENT, SERVER, RENDER;
|
||||
LEVEL, PLAYER, CLIENT, SERVER, RENDER
|
||||
}
|
||||
|
||||
public enum Phase {
|
||||
START, END;
|
||||
START, END
|
||||
}
|
||||
|
||||
public final Type type;
|
||||
@@ -35,7 +35,7 @@ public class TickEvent extends Event {
|
||||
this.phase = phase;
|
||||
}
|
||||
|
||||
public static class ServerTickEvent extends TickEvent {
|
||||
public static sealed class ServerTickEvent extends TickEvent {
|
||||
private final BooleanSupplier haveTime;
|
||||
private final MinecraftServer server;
|
||||
|
||||
@@ -61,38 +61,38 @@ public class TickEvent extends Event {
|
||||
return server;
|
||||
}
|
||||
|
||||
public static class Pre extends ServerTickEvent {
|
||||
public static final class Pre extends ServerTickEvent {
|
||||
public Pre(BooleanSupplier haveTime, MinecraftServer server) {
|
||||
super(haveTime, server, Phase.START);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Post extends ServerTickEvent {
|
||||
public static final class Post extends ServerTickEvent {
|
||||
public Post(BooleanSupplier haveTime, MinecraftServer server) {
|
||||
super(haveTime, server, Phase.END);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class ClientTickEvent extends TickEvent {
|
||||
public static sealed class ClientTickEvent extends TickEvent {
|
||||
protected ClientTickEvent(Phase phase) {
|
||||
super(Type.CLIENT, LogicalSide.CLIENT, phase);
|
||||
}
|
||||
|
||||
public static class Pre extends ClientTickEvent {
|
||||
public static final class Pre extends ClientTickEvent {
|
||||
public Pre() {
|
||||
super(Phase.START);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Post extends ClientTickEvent {
|
||||
public static final class Post extends ClientTickEvent {
|
||||
public Post() {
|
||||
super(Phase.END);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class LevelTickEvent extends TickEvent {
|
||||
public static sealed class LevelTickEvent extends TickEvent {
|
||||
public final Level level;
|
||||
private final BooleanSupplier haveTime;
|
||||
|
||||
@@ -112,20 +112,20 @@ public class TickEvent extends Event {
|
||||
return this.haveTime.getAsBoolean();
|
||||
}
|
||||
|
||||
public static class Pre extends LevelTickEvent {
|
||||
public static final class Pre extends LevelTickEvent {
|
||||
public Pre(LogicalSide side, Level level, BooleanSupplier haveTime) {
|
||||
super(side, level, haveTime, Phase.START);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Post extends LevelTickEvent {
|
||||
public static final class Post extends LevelTickEvent {
|
||||
public Post(LogicalSide side, Level level, BooleanSupplier haveTime) {
|
||||
super(side, level, haveTime, Phase.END);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class PlayerTickEvent extends TickEvent {
|
||||
public static sealed class PlayerTickEvent extends TickEvent {
|
||||
public final Player player;
|
||||
|
||||
protected PlayerTickEvent(Player player, Phase phase) {
|
||||
@@ -133,20 +133,20 @@ public class TickEvent extends Event {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public static class Pre extends PlayerTickEvent {
|
||||
public static final class Pre extends PlayerTickEvent {
|
||||
public Pre(Player player) {
|
||||
super(player, Phase.START);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Post extends PlayerTickEvent {
|
||||
public static final class Post extends PlayerTickEvent {
|
||||
public Post(Player player) {
|
||||
super(player, Phase.END);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class RenderTickEvent extends TickEvent {
|
||||
public static sealed class RenderTickEvent extends TickEvent {
|
||||
private final DeltaTracker timer;
|
||||
|
||||
private RenderTickEvent(Phase phase, DeltaTracker timer) {
|
||||
@@ -158,13 +158,13 @@ public class TickEvent extends Event {
|
||||
return this.timer;
|
||||
}
|
||||
|
||||
public static class Pre extends RenderTickEvent {
|
||||
public static final class Pre extends RenderTickEvent {
|
||||
public Pre(DeltaTracker timer) {
|
||||
super(Phase.START, timer);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Post extends RenderTickEvent {
|
||||
public static final class Post extends RenderTickEvent {
|
||||
public Post(DeltaTracker timer) {
|
||||
super(Phase.END, timer);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* Cancel this event to prevent Vanilla from posting the {@link GameEvent} to all nearby {@link net.minecraft.world.level.gameevent.GameEventListener GameEventListeners}.
|
||||
**/
|
||||
@Cancelable
|
||||
public class VanillaGameEvent extends Event
|
||||
public final class VanillaGameEvent extends Event
|
||||
{
|
||||
private final Level level;
|
||||
private final GameEvent vanillaEvent;
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraftforge.common.brewing.BrewingRecipe;
|
||||
import net.minecraftforge.common.brewing.IBrewingRecipe;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
|
||||
public class BrewingRecipeRegisterEvent extends Event {
|
||||
public final class BrewingRecipeRegisterEvent extends Event {
|
||||
private final PotionBrewing.Builder builder;
|
||||
private final FeatureFlagSet features;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
* This event is called when a player picks up a potion from a brewing stand.
|
||||
*/
|
||||
public class PlayerBrewedPotionEvent extends PlayerEvent
|
||||
public final class PlayerBrewedPotionEvent extends PlayerEvent
|
||||
{
|
||||
private final ItemStack stack;
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class PotionBrewEvent extends Event
|
||||
public sealed class PotionBrewEvent extends Event
|
||||
{
|
||||
private NonNullList<ItemStack> stacks;
|
||||
private final NonNullList<ItemStack> stacks;
|
||||
|
||||
protected PotionBrewEvent(NonNullList<ItemStack> stacks)
|
||||
{
|
||||
@@ -59,7 +59,7 @@ public class PotionBrewEvent extends Event
|
||||
* If this event is canceled, and items have been modified, PotionBrewEvent.Post will automatically be fired.
|
||||
**/
|
||||
@Cancelable
|
||||
public static class Pre extends PotionBrewEvent
|
||||
public static final class Pre extends PotionBrewEvent
|
||||
{
|
||||
public Pre(NonNullList<ItemStack> stacks)
|
||||
{
|
||||
@@ -80,7 +80,7 @@ public class PotionBrewEvent extends Event
|
||||
* <br>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
||||
**/
|
||||
public static class Post extends PotionBrewEvent
|
||||
public static final class Post extends PotionBrewEvent
|
||||
{
|
||||
public Post(NonNullList<ItemStack> stacks)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* from 0-15 and indicates how many bookshelves surround the enchanting table. The {@link #itemStack} representing the item being
|
||||
* enchanted is also available.
|
||||
*/
|
||||
public class EnchantmentLevelSetEvent extends net.minecraftforge.eventbus.api.Event
|
||||
public final class EnchantmentLevelSetEvent extends net.minecraftforge.eventbus.api.Event
|
||||
{
|
||||
private final Level level;
|
||||
private final BlockPos pos;
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraftforge.fml.event.IModBusEvent;
|
||||
* <br>
|
||||
* Fired on the Mod bus {@link IModBusEvent}.<br>
|
||||
**/
|
||||
public class EntityAttributeCreationEvent extends Event implements IModBusEvent {
|
||||
public final class EntityAttributeCreationEvent extends Event implements IModBusEvent {
|
||||
private final Map<EntityType<? extends LivingEntity>, AttributeSupplier> map;
|
||||
|
||||
public EntityAttributeCreationEvent(Map<EntityType<? extends LivingEntity>, AttributeSupplier> map) {
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.stream.Collectors;
|
||||
* <br>
|
||||
* Fired on the Mod bus {@link IModBusEvent}.<br>
|
||||
**/
|
||||
public class EntityAttributeModificationEvent extends Event implements IModBusEvent {
|
||||
public final class EntityAttributeModificationEvent extends Event implements IModBusEvent {
|
||||
private final Map<EntityType<? extends LivingEntity>, AttributeSupplier.Builder> entityAttributes;
|
||||
private final List<EntityType<? extends LivingEntity>> entityTypes;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class EntityEvent extends Event {
|
||||
* <br>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
||||
**/
|
||||
public static class EntityConstructing extends EntityEvent {
|
||||
public static final class EntityConstructing extends EntityEvent {
|
||||
public EntityConstructing(Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class EntityEvent extends Event {
|
||||
* <br>
|
||||
* This event is fired on the {@link net.minecraftforge.common.MinecraftForge#EVENT_BUS}.<br>
|
||||
**/
|
||||
public static class EnteringSection extends EntityEvent {
|
||||
public static final class EnteringSection extends EntityEvent {
|
||||
private final long packedOldPos;
|
||||
private final long packedNewPos;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraftforge.fml.LogicalSide;
|
||||
* on both logical sides.
|
||||
**/
|
||||
@Cancelable
|
||||
public class EntityJoinLevelEvent extends EntityEvent {
|
||||
public final class EntityJoinLevelEvent extends EntityEvent {
|
||||
private final Level level;
|
||||
private final boolean loadedFromDisk;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
* This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus}
|
||||
* on both logical sides.
|
||||
**/
|
||||
public class EntityLeaveLevelEvent extends EntityEvent {
|
||||
public final class EntityLeaveLevelEvent extends EntityEvent {
|
||||
private final Level level;
|
||||
|
||||
public EntityLeaveLevelEvent(Entity entity, Level level) {
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
*/
|
||||
@HasResult
|
||||
public class EntityMobGriefingEvent extends EntityEvent
|
||||
public final class EntityMobGriefingEvent extends EntityEvent
|
||||
{
|
||||
public EntityMobGriefingEvent(Entity entity)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
*/
|
||||
|
||||
@Cancelable
|
||||
public class EntityMountEvent extends EntityEvent
|
||||
public final class EntityMountEvent extends EntityEvent
|
||||
{
|
||||
|
||||
private final Entity entityMounting;
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
||||
**/
|
||||
@net.minecraftforge.eventbus.api.Cancelable
|
||||
public class EntityStruckByLightningEvent extends EntityEvent
|
||||
public final class EntityStruckByLightningEvent extends EntityEvent
|
||||
{
|
||||
private final LightningBolt lightning;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
||||
**/
|
||||
@Cancelable
|
||||
public class EntityTeleportEvent extends EntityEvent
|
||||
public sealed class EntityTeleportEvent extends EntityEvent
|
||||
{
|
||||
protected double targetX;
|
||||
protected double targetY;
|
||||
@@ -70,7 +70,7 @@ public class EntityTeleportEvent extends EntityEvent
|
||||
* If this event is canceled, the entity will not be teleported.
|
||||
*/
|
||||
@Cancelable
|
||||
public static class TeleportCommand extends EntityTeleportEvent
|
||||
public static final class TeleportCommand extends EntityTeleportEvent
|
||||
{
|
||||
public TeleportCommand(Entity entity, double targetX, double targetY, double targetZ)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ public class EntityTeleportEvent extends EntityEvent
|
||||
* If this event is canceled, the entity will not be teleported.
|
||||
*/
|
||||
@Cancelable
|
||||
public static class SpreadPlayersCommand extends EntityTeleportEvent
|
||||
public static final class SpreadPlayersCommand extends EntityTeleportEvent
|
||||
{
|
||||
public SpreadPlayersCommand(Entity entity, double targetX, double targetY, double targetZ)
|
||||
{
|
||||
@@ -117,7 +117,7 @@ public class EntityTeleportEvent extends EntityEvent
|
||||
* If this event is canceled, the entity will not be teleported.
|
||||
*/
|
||||
@Cancelable
|
||||
public static class EnderEntity extends EntityTeleportEvent
|
||||
public static final class EnderEntity extends EntityTeleportEvent
|
||||
{
|
||||
private final LivingEntity entityLiving;
|
||||
|
||||
@@ -148,7 +148,7 @@ public class EntityTeleportEvent extends EntityEvent
|
||||
* If this event is canceled, the entity will not be teleported.
|
||||
*/
|
||||
@Cancelable
|
||||
public static class EnderPearl extends EntityTeleportEvent
|
||||
public static final class EnderPearl extends EntityTeleportEvent
|
||||
{
|
||||
private final ServerPlayer player;
|
||||
private final ThrownEnderpearl pearlEntity;
|
||||
@@ -207,7 +207,7 @@ public class EntityTeleportEvent extends EntityEvent
|
||||
* If this event is canceled, the entity will not be teleported.
|
||||
*/
|
||||
@Cancelable
|
||||
public static class ChorusFruit extends EntityTeleportEvent
|
||||
public static final class ChorusFruit extends EntityTeleportEvent
|
||||
{
|
||||
private final LivingEntity entityLiving;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
||||
**/
|
||||
@Cancelable
|
||||
public class EntityTravelToDimensionEvent extends EntityEvent
|
||||
public final class EntityTravelToDimensionEvent extends EntityEvent
|
||||
{
|
||||
private final ResourceKey<Level> dimension;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.Objects;
|
||||
* You can also directly set the {@link ImpactResult} to change the impact behaviour.
|
||||
* @see #setImpactResult(ImpactResult)
|
||||
*/
|
||||
public class ProjectileImpactEvent extends EntityEvent {
|
||||
public final class ProjectileImpactEvent extends EntityEvent {
|
||||
private final HitResult ray;
|
||||
private final Projectile projectile;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
*
|
||||
* Fired on the Mod bus {@link IModBusEvent}.<br>
|
||||
*/
|
||||
public class SpawnPlacementRegisterEvent extends Event implements IModBusEvent {
|
||||
public final class SpawnPlacementRegisterEvent extends Event implements IModBusEvent {
|
||||
private final Map<EntityType<?>, MergedSpawnPredicate<?>> map;
|
||||
|
||||
@ApiStatus.Internal
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.world.entity.item.ItemEntity;
|
||||
* it will add more time to the entities life equal to extraLife.
|
||||
*/
|
||||
@Cancelable
|
||||
public class ItemExpireEvent extends ItemEvent
|
||||
public final class ItemExpireEvent extends ItemEvent
|
||||
{
|
||||
|
||||
private int extraLife;
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.minecraft.world.entity.player.Player;
|
||||
* removed from the inventory - and thus removed from the system.
|
||||
*/
|
||||
@Cancelable
|
||||
public class ItemTossEvent extends ItemEvent
|
||||
public final class ItemTossEvent extends ItemEvent
|
||||
{
|
||||
|
||||
private final Player player;
|
||||
|
||||
@@ -19,7 +19,7 @@ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
*/
|
||||
@Cancelable
|
||||
public class AnimalTameEvent extends LivingEvent
|
||||
public final class AnimalTameEvent extends LivingEvent
|
||||
{
|
||||
private final Animal animal;
|
||||
private final Player tamer;
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
**/
|
||||
@Cancelable
|
||||
public class BabyEntitySpawnEvent extends Event {
|
||||
public final class BabyEntitySpawnEvent extends Event {
|
||||
private final Mob parentA;
|
||||
private final Mob parentB;
|
||||
private final Player causedByPlayer;
|
||||
|
||||
@@ -31,7 +31,7 @@ import net.minecraft.world.entity.LivingEntity;
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
**/
|
||||
@Cancelable
|
||||
public class LivingAttackEvent extends LivingEvent
|
||||
public final class LivingAttackEvent extends LivingEvent
|
||||
{
|
||||
private final DamageSource source;
|
||||
private final float amount;
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
* <br>
|
||||
* This event is fired on {@link MinecraftForge#EVENT_BUS}
|
||||
*/
|
||||
public class LivingBreatheEvent extends LivingEvent {
|
||||
public final class LivingBreatheEvent extends LivingEvent {
|
||||
private boolean canBreathe;
|
||||
private boolean canRefillAir;
|
||||
private int consumeAirAmount;
|
||||
|
||||
@@ -34,7 +34,7 @@ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
*/
|
||||
@Cancelable
|
||||
public class LivingChangeTargetEvent extends LivingEvent {
|
||||
public final class LivingChangeTargetEvent extends LivingEvent {
|
||||
private final ILivingTargetType targetType;
|
||||
private final LivingEntity originalTarget;
|
||||
private LivingEntity newTarget;
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.function.Consumer;
|
||||
* Tadpole -> Frog when it grows up
|
||||
* Mushroom Cow -> Cow when sheared
|
||||
*/
|
||||
public class LivingConversionEvent extends LivingEvent {
|
||||
public sealed class LivingConversionEvent extends LivingEvent {
|
||||
public LivingConversionEvent(LivingEntity entity) {
|
||||
super(entity);
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class LivingConversionEvent extends LivingEvent {
|
||||
* If cancelled, the replacement will not occur
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends LivingConversionEvent {
|
||||
public static final class Pre extends LivingConversionEvent {
|
||||
private final EntityType<? extends LivingEntity> outcome;
|
||||
private final Consumer<Integer> timer;
|
||||
|
||||
@@ -79,7 +79,7 @@ public class LivingConversionEvent extends LivingEvent {
|
||||
* itself with another entity.
|
||||
* The old living entity is likely to be removed right after this event.
|
||||
*/
|
||||
public static class Post extends LivingConversionEvent {
|
||||
public static final class Post extends LivingConversionEvent {
|
||||
private final LivingEntity outcome;
|
||||
|
||||
public Post(LivingEntity entity, LivingEntity outcome) {
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.minecraft.world.entity.LivingEntity;
|
||||
* @see LivingHurtEvent
|
||||
**/
|
||||
@Cancelable
|
||||
public class LivingDamageEvent extends LivingEvent
|
||||
public final class LivingDamageEvent extends LivingEvent
|
||||
{
|
||||
private final DamageSource source;
|
||||
private float amount;
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.minecraft.world.entity.LivingEntity;
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
**/
|
||||
@Cancelable
|
||||
public class LivingDeathEvent extends LivingEvent
|
||||
public final class LivingDeathEvent extends LivingEvent
|
||||
{
|
||||
private final DamageSource source;
|
||||
public LivingDeathEvent(LivingEntity entity, DamageSource source)
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
**/
|
||||
@Cancelable
|
||||
public class LivingDestroyBlockEvent extends LivingEvent
|
||||
public final class LivingDestroyBlockEvent extends LivingEvent
|
||||
{
|
||||
private final BlockPos pos;
|
||||
private final BlockState state;
|
||||
|
||||
@@ -34,7 +34,7 @@ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
**/
|
||||
@net.minecraftforge.eventbus.api.Cancelable
|
||||
public class LivingDropsEvent extends LivingEvent {
|
||||
public final class LivingDropsEvent extends LivingEvent {
|
||||
private final DamageSource source;
|
||||
private final Collection<ItemEntity> drops;
|
||||
private final boolean recentlyHit;
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
* This event is fired on {@link MinecraftForge#EVENT_BUS}
|
||||
**/
|
||||
@Cancelable
|
||||
public class LivingDrownEvent extends LivingEvent {
|
||||
public final class LivingDrownEvent extends LivingEvent {
|
||||
private boolean isDrowning;
|
||||
private float damageAmount;
|
||||
private int bubbleCount;
|
||||
|
||||
@@ -10,7 +10,7 @@ import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class LivingEntityUseItemEvent extends LivingEvent
|
||||
public sealed class LivingEntityUseItemEvent extends LivingEvent
|
||||
{
|
||||
private final ItemStack item;
|
||||
private int duration;
|
||||
@@ -50,7 +50,7 @@ public class LivingEntityUseItemEvent extends LivingEvent
|
||||
*
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Start extends LivingEntityUseItemEvent
|
||||
public static final class Start extends LivingEntityUseItemEvent
|
||||
{
|
||||
public Start(LivingEntity entity, @NotNull ItemStack item, int duration)
|
||||
{
|
||||
@@ -65,7 +65,7 @@ public class LivingEntityUseItemEvent extends LivingEvent
|
||||
*
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Tick extends LivingEntityUseItemEvent
|
||||
public static final class Tick extends LivingEntityUseItemEvent
|
||||
{
|
||||
public Tick(LivingEntity entity, @NotNull ItemStack item, int duration)
|
||||
{
|
||||
@@ -86,7 +86,7 @@ public class LivingEntityUseItemEvent extends LivingEvent
|
||||
* The only vanilla item this would effect are bows, and it would cause them NOT to fire there arrow.
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Stop extends LivingEntityUseItemEvent
|
||||
public static final class Stop extends LivingEntityUseItemEvent
|
||||
{
|
||||
public Stop(LivingEntity entity, @NotNull ItemStack item, int duration)
|
||||
{
|
||||
@@ -106,7 +106,7 @@ public class LivingEntityUseItemEvent extends LivingEvent
|
||||
* The result item stack is the stack that is placed in the player's inventory in replacement of the stack that is currently being used.
|
||||
*
|
||||
*/
|
||||
public static class Finish extends LivingEntityUseItemEvent
|
||||
public static final class Finish extends LivingEntityUseItemEvent
|
||||
{
|
||||
private ItemStack result;
|
||||
public Finish(LivingEntity entity, @NotNull ItemStack item, int duration, @NotNull ItemStack result)
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* <br>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
**/
|
||||
public class LivingEquipmentChangeEvent extends LivingEvent {
|
||||
public final class LivingEquipmentChangeEvent extends LivingEvent {
|
||||
private final EquipmentSlot slot;
|
||||
private final ItemStack from;
|
||||
private final ItemStack to;
|
||||
|
||||
@@ -51,7 +51,7 @@ public class LivingEvent extends EntityEvent
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
**/
|
||||
@Cancelable
|
||||
public static class LivingTickEvent extends LivingEvent
|
||||
public static final class LivingTickEvent extends LivingEvent
|
||||
{
|
||||
public LivingTickEvent(LivingEntity e){ super(e); }
|
||||
}
|
||||
@@ -70,12 +70,12 @@ public class LivingEvent extends EntityEvent
|
||||
* <br>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
**/
|
||||
public static class LivingJumpEvent extends LivingEvent
|
||||
public static final class LivingJumpEvent extends LivingEvent
|
||||
{
|
||||
public LivingJumpEvent(LivingEntity e){ super(e); }
|
||||
}
|
||||
|
||||
public static class LivingVisibilityEvent extends LivingEvent
|
||||
public static final class LivingVisibilityEvent extends LivingEvent
|
||||
{
|
||||
private double visibilityModifier;
|
||||
@Nullable
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* by canceling the event.
|
||||
*/
|
||||
@Cancelable
|
||||
public class LivingExperienceDropEvent extends LivingEvent
|
||||
public final class LivingExperienceDropEvent extends LivingEvent
|
||||
{
|
||||
@Nullable private final Player attackingPlayer;
|
||||
private final int originalExperiencePoints;
|
||||
|
||||
@@ -28,7 +28,7 @@ import net.minecraft.world.entity.LivingEntity;
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
**/
|
||||
@Cancelable
|
||||
public class LivingFallEvent extends LivingEvent {
|
||||
public final class LivingFallEvent extends LivingEvent {
|
||||
private double distance;
|
||||
private float damageMultiplier;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import net.minecraft.world.item.ItemStack;
|
||||
* <p>
|
||||
* This event is fired on the {@link net.minecraftforge.common.MinecraftForge#EVENT_BUS}.
|
||||
*/
|
||||
public class LivingGetProjectileEvent extends LivingEvent
|
||||
public final class LivingGetProjectileEvent extends LivingEvent
|
||||
{
|
||||
private final ItemStack projectileWeaponItemStack;
|
||||
private ItemStack projectileItemStack;
|
||||
|
||||
Loaded 100 of 174 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user