Deprecate some rarely used events for removal (#10904)

See PR description for details
This commit is contained in:
Paint_Ninja authored and GitHub committed 2026-10-29 17:49:21 +00:00
1 parent 7d0bd1898f
commit cd8eccc29c
7 files changed
+28 -3

No files matched your search

@@ -13,7 +13,12 @@ import java.util.Set;
/**
* Fired when an Atlas is being loaded.
* This allows you to add custom metadata sections that will be loaded from the sprite's .mcmeta file.
*
* @deprecated This event is scheduled for removal in 26.4 due to a lack of adoption by mods, in order to ease porting.
* Please reach out to the Forge team if you are relying on this and would like to see it remain in Forge.
* We may keep it or add it back in a future version if there is enough demand.
*/
@Deprecated(forRemoval = true, since = "26.4")
public final class GatherAtlasMetadataSectionsEvent extends MutableEvent {
public static final EventBus<GatherAtlasMetadataSectionsEvent> BUS = EventBus.create(GatherAtlasMetadataSectionsEvent.class);
@@ -26,4 +31,4 @@ public final class GatherAtlasMetadataSectionsEvent extends MutableEvent {
public void addType(MetadataSectionType<?> definition) {
this.types.add(definition);
}
}
}
@@ -42,6 +42,7 @@ import org.jspecify.annotations.Nullable;
* </ul>
* Of course, nothing egregious will happen should a modder choose to use them for their own purposes.<br>
*/
@Deprecated(forRemoval = true, since = "26.4")
public class BrainBuilder<E extends LivingEntity> {
private final Collection<MemoryModuleType<?>> memoryTypes = new HashSet<>();
private final Collection<SensorType<? extends Sensor<? super E>>> sensorTypes = new HashSet<>();
@@ -24,7 +24,12 @@ import net.minecraftforge.eventbus.api.event.MutableEvent;
* and replace the previously created Brain instance for the entity.<br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingMakeBrain(LivingEntity, Brain, Dynamic)}.<br>
*
* @deprecated This event is scheduled for removal in 26.4 due to a lack of adoption by mods, in order to ease porting.
* Please reach out to the Forge team if you are relying on this and would like to see it remain in Forge.
* We may keep it or add it back in a future version if there is enough demand.
**/
@Deprecated(forRemoval = true, since = "26.4")
public final class LivingMakeBrainEvent extends MutableEvent implements LivingEvent {
public static final EventBus<LivingMakeBrainEvent> BUS = EventBus.create(LivingMakeBrainEvent.class);
@@ -12,6 +12,10 @@ import net.minecraftforge.eventbus.api.bus.EventBus;
import net.minecraftforge.eventbus.api.event.MutableEvent;
import org.jspecify.annotations.NullMarked;
/// @deprecated This event is scheduled for removal in 26.4 due to a lack of adoption by mods, in order to ease porting.
/// Please reach out to the Forge team if you are relying on this and would like to see it remain in Forge.
/// We may keep it or add it back in a future version if there is enough demand.
@Deprecated(forRemoval = true, since = "26.4")
@NullMarked
public final class LivingPackSizeEvent extends MutableEvent implements LivingEvent, HasResult {
public static final EventBus<LivingPackSizeEvent> BUS = EventBus.create(LivingPackSizeEvent.class);
@@ -7,14 +7,14 @@ package net.minecraftforge.event.entity.living;
import net.minecraft.world.entity.monster.Monster;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.common.extensions.IForgeItem;
import net.minecraftforge.common.extensions.IForgeItemStack;
import net.minecraftforge.eventbus.api.bus.CancellableEventBus;
import net.minecraftforge.eventbus.api.event.RecordEvent;
import net.minecraftforge.eventbus.api.event.characteristic.Cancellable;
/**
* This event is fired on the forge bus before an Monster detects that a player is looking at them.
* It will not be fired if the detection is already prevented by {@link IForgeItem#isEnderMask}
* It will not be fired if the detection is already prevented by {@link IForgeItemStack#isMonsterDisguise(Player, Monster)}
* <p>
* This event is {@linkplain Cancellable cancellable}.
* If this event is cancelled, the Monster will not target the player.
@@ -22,7 +22,12 @@ import org.jetbrains.annotations.ApiStatus;
* This event is not {@linkplain Cancellable cancellable}.
* <p>
* This event is fired only on the {@linkplain net.minecraftforge.fml.LogicalSide#SERVER logical server}.
*
* @deprecated This event is scheduled for removal in 26.4 due to a lack of adoption by mods, in order to ease porting.
* Please reach out to the Forge team if you are relying on this and would like to see it remain in Forge.
* We may keep it or add it back in a future version if there is enough demand.
*/
@Deprecated(forRemoval = true, since = "26.4")
public final class AlterGroundEvent extends MutableEvent {
public static final EventBus<AlterGroundEvent> BUS = EventBus.create(AlterGroundEvent.class);
@@ -27,7 +27,12 @@ import org.jetbrains.annotations.Nullable;
* {@linkplain Result#DENY DENY} will prevent the sapling from growing.
* <p>
* This event is fired only on the {@linkplain net.minecraftforge.fml.LogicalSide#SERVER logical server}.
*
* @deprecated This event is scheduled for removal in 26.4 due to a lack of adoption by mods, in order to ease porting.
* Please reach out to the Forge team if you are relying on this and would like to see it remain in Forge.
* We may keep it or add it back in a future version if there is enough demand.
*/
@Deprecated(forRemoval = true, since = "26.4")
public final class BlockFeatureGrowEvent implements LevelEvent, HasResult {
public static final EventBus<BlockFeatureGrowEvent> BUS = EventBus.create(BlockFeatureGrowEvent.class);