[1.17.x Omnibus] Fix typos and javadocs across code base (#8144)

This commit is contained in:
sciwhiz12 authored and GitHub committed 2021-11-25 13:09:56 -08:00
1 parent df8954869a
commit b4feee8046
163 files changed
+708 -454

No files matched your search

@@ -24,7 +24,8 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
/**
* Call {@link net.minecraft.client.world.DimensionRenderInfo#setCloudRenderHandler(ICloudRenderHandler)}, obtained from a {@link ClientWorld} with an implementation of this to override all cloud rendering with your own.
* Call {@link net.minecraft.client.renderer.DimensionSpecialEffects#setCloudRenderHandler(ICloudRenderHandler)},
* obtained from a {@link ClientLevel} with an implementation of this to override all cloud rendering with your own.
* This is only responsible for rendering clouds.
*/
@FunctionalInterface
@@ -24,7 +24,8 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
/**
* Call {@link net.minecraft.client.world.DimensionRenderInfo#setSkyRenderHandler(ISkyRenderHandler)}, obtained from a {@link ClientWorld} with an implementation of this to override all sky rendering with your own.
* Call {@link net.minecraft.client.renderer.DimensionSpecialEffects#setSkyRenderHandler(ISkyRenderHandler)}, obtained
* from a {@link ClientLevel} with an implementation of this to override all sky rendering with your own.
* This includes the sun, moon, stars, and sky-coloring.
*/
@FunctionalInterface
@@ -24,7 +24,8 @@ import net.minecraft.client.Camera;
import net.minecraft.client.multiplayer.ClientLevel;
/**
* Call {@link net.minecraft.client.world.DimensionRenderInfo#setWeatherParticleRenderHandler(net.minecraftforge.client.IWeatherParticleRenderHandler)}, obtained from a {@link ClientWorld} with an implementation of this to override all weather particle rendering with your own.
* Call {@link net.minecraft.client.renderer.DimensionSpecialEffects#setWeatherParticleRenderHandler(IWeatherParticleRenderHandler)},
* obtained from a {@link ClientLevel} with an implementation of this to override all weather particle rendering with your own.
* This handles ground particles that can be seen when it's raining (splash/smoke particles).
* This also includes playing rain sounds.
*/
@@ -24,7 +24,8 @@ import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.multiplayer.ClientLevel;
/**
* Call {@link net.minecraft.client.world.DimensionRenderInfo#setWeatherRenderHandler(IWeatherRenderHandler)}, obtained from a {@link ClientWorld} with an implementation of this to override all weather rendering with your own.
* Call {@link net.minecraft.client.renderer.DimensionSpecialEffects#setWeatherRenderHandler(IWeatherRenderHandler)},
* obtained from a {@link ClientLevel} with an implementation of this to override all weather rendering with your own.
* This includes rain and snow.
*/
@FunctionalInterface
@@ -20,13 +20,16 @@
package net.minecraftforge.client.event;
import com.google.common.base.Strings;
import net.minecraft.client.gui.screens.Screen;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;
/**
* ClientChatEvent is fired whenever the client is about to send a chat message or command to the server. <br>
* This event is fired via {@link ForgeEventFactory#onClientSendMessage(String)},
* which is executed by {@link GuiScreen#sendChatMessage(String, boolean)}<br>
* which is executed by {@link Screen#sendMessage(String, boolean)}<br>
* <br>
* {@link #message} contains the message that will be sent to the server. This can be changed by mods.<br>
* {@link #originalMessage} contains the original message that was going to be sent to the server. This cannot be changed by mods.<br>
@@ -64,7 +64,7 @@ public class ClientChatReceivedEvent extends Event
/**
* The UUID of the player or entity that sent this message, or null if not known.
* This will be equal to {@link net.minecraft.util.Util#DUMMY_UUID} for system messages.
* This will be equal to {@link net.minecraft.Util#NIL_UUID} for system messages.
*/
@Nullable
public UUID getSenderUUID()
+26 -25
View File
@@ -24,15 +24,16 @@ import java.util.List;
import java.util.function.Consumer;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.gui.components.Widget;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.screens.inventory.EffectRenderingInventoryScreen;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraft.client.gui.components.AbstractWidget;
import net.minecraft.client.gui.screens.Screen;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;
import org.lwjgl.glfw.GLFW;
/**
* Event classes for GuiScreen events.
@@ -91,10 +92,10 @@ public class GuiScreenEvent extends Event
}
/**
* This event fires just after initializing {@link GuiScreen#mc}, {@link GuiScreen#fontRenderer},
* {@link GuiScreen#width}, and {@link GuiScreen#height}.<br/><br/>
* This event fires just after initializing the {@link Minecraft}, font renderer, width,
* and height fields.<br/><br/>
*
* If canceled the following lines are skipped in {@link GuiScreen#setWorldAndResolution(Minecraft, int, int)}:<br/>
* If canceled the following lines are skipped in {@link Screen#init(Minecraft, int, int)}:<br/>
* {@code this.buttonList.clear();}<br/>
* {@code this.children.clear();}<br/>
* {@code this.initGui();}<br/>
@@ -109,7 +110,7 @@ public class GuiScreenEvent extends Event
}
/**
* This event fires right after {@link GuiScreen#initGui()}.
* This event fires right after {@code Screen#init()}.
* This is a good place to alter a GuiScreen's component layout if desired.
*/
public static class Post extends InitGuiEvent
@@ -170,8 +171,8 @@ public class GuiScreenEvent extends Event
}
/**
* This event fires just before {@link GuiScreen#render(int, int, float)} is called.
* Cancel this event to skip {@link GuiScreen#render(int, int, float)}.
* This event fires just before {@link Screen#render(PoseStack, int, int, float)} is called.
* Cancel this event to skip the render method.
*/
@Cancelable
public static class Pre extends DrawScreenEvent
@@ -183,7 +184,7 @@ public class GuiScreenEvent extends Event
}
/**
* This event fires just after {@link GuiScreen#render(int, int, float)} is called.
* This event fires just after {@link Screen#render(PoseStack, int, int, float)} is called.
*/
public static class Post extends DrawScreenEvent
{
@@ -195,7 +196,7 @@ public class GuiScreenEvent extends Event
}
/**
* This event fires at the end of {@link GuiScreen#drawBackground(int)} and before the rest of the Gui draws.
* This event fires at the end of {@link Screen#renderBackground(PoseStack, int)} and before the rest of the Gui draws.
* This allows drawing next to Guis, above the background but below any tooltips.
*/
public static class BackgroundDrawnEvent extends GuiScreenEvent
@@ -218,8 +219,8 @@ public class GuiScreenEvent extends Event
}
/**
* This event fires in {@link InventoryEffectRenderer#updateActivePotionEffects()}
* when potion effects are active and the gui wants to move over.
* This event fires in {@link EffectRenderingInventoryScreen} in the
* {@code checkEffectRendering} method when potion effects are active and the gui wants to move over.
* Cancel this event to prevent the Gui from being moved.
*/
@Cancelable
@@ -271,7 +272,7 @@ public class GuiScreenEvent extends Event
/**
* This event fires when a mouse click is detected for a GuiScreen, before it is handled.
* Cancel this event to bypass {@link IGuiEventListener#mouseClicked(double, double, int)}.
* Cancel this event to bypass {@link GuiEventListener#mouseClicked(double, double, int)}.
*/
@Cancelable
public static class Pre extends MouseClickedEvent
@@ -345,7 +346,7 @@ public class GuiScreenEvent extends Event
/**
* This event fires when a mouse release is detected for a GuiScreen, before it is handled.
* Cancel this event to bypass {@link IGuiEventListener#mouseReleased(double, double, int)}.
* Cancel this event to bypass {@link GuiEventListener#mouseReleased(double, double, int)}.
*/
@Cancelable
public static class Pre extends MouseReleasedEvent
@@ -433,7 +434,7 @@ public class GuiScreenEvent extends Event
/**
* This event fires when a mouse drag is detected for a GuiScreen, before it is handled.
* Cancel this event to bypass {@link IGuiEventListener#mouseDragged(double, double, int, double, double)}.
* Cancel this event to bypass {@link GuiEventListener#mouseDragged(double, double, int, double, double)}.
*/
@Cancelable
public static class Pre extends MouseDragEvent
@@ -445,7 +446,7 @@ public class GuiScreenEvent extends Event
}
/**
* This event fires after {@link IGuiEventListener#mouseDragged(double, double, int, double, double)} if the drag was not already handled.
* This event fires after {@link GuiEventListener#mouseDragged(double, double, int, double, double)} if the drag was not already handled.
* Cancel this event when you successfully use the mouse drag, to prevent other handlers from using the same input.
*/
@Cancelable
@@ -475,7 +476,7 @@ public class GuiScreenEvent extends Event
/**
* This event fires when a mouse scroll is detected for a GuiScreen, before it is handled.
* Cancel this event to bypass {@link IGuiEventListener#mouseScrolled(double)}.
* Cancel this event to bypass {@link GuiEventListener#mouseScrolled(double, double, double)}.
*/
@Cancelable
public static class Pre extends MouseScrollEvent
@@ -487,7 +488,7 @@ public class GuiScreenEvent extends Event
}
/**
* This event fires after {@link IGuiEventListener#mouseScrolled(double)} if the scroll was not already handled.
* This event fires after {@link GuiEventListener#mouseScrolled(double, double, double)} if the scroll was not already handled.
* Cancel this event when you successfully use the mouse scroll, to prevent other handlers from using the same input.
*/
@Cancelable
@@ -527,7 +528,7 @@ public class GuiScreenEvent extends Event
/**
* Platform-specific scan code.
* Used for {@link InputMappings#getInputByCode(int, int)}
* Used for {@link com.mojang.blaze3d.platform.InputConstants#getKey(int, int)}
*
* The scan code is unique for every key, regardless of whether it has a key code.
* Scan codes are platform-specific but consistent over time, so keys will have different scan codes depending
@@ -562,7 +563,7 @@ public class GuiScreenEvent extends Event
/**
* This event fires when keyboard input is detected for a GuiScreen, before it is handled.
* Cancel this event to bypass {@link IGuiEventListener#keyPressed(int, int, int)}.
* Cancel this event to bypass {@link GuiEventListener#keyPressed(int, int, int)}.
*/
@Cancelable
public static class Pre extends KeyboardKeyPressedEvent
@@ -574,7 +575,7 @@ public class GuiScreenEvent extends Event
}
/**
* This event fires after {@link IGuiEventListener#keyPressed(int, int, int)} if the key was not already handled.
* This event fires after {@link GuiEventListener#keyPressed(int, int, int)} if the key was not already handled.
* Cancel this event when you successfully use the keyboard input to prevent other handlers from using the same input.
*/
@Cancelable
@@ -596,7 +597,7 @@ public class GuiScreenEvent extends Event
/**
* This event fires when keyboard input is detected for a GuiScreen, before it is handled.
* Cancel this event to bypass {@link IGuiEventListener#keyReleased(int, int, int)}.
* Cancel this event to bypass {@link GuiEventListener#keyReleased(int, int, int)}.
*/
@Cancelable
public static class Pre extends KeyboardKeyReleasedEvent
@@ -608,7 +609,7 @@ public class GuiScreenEvent extends Event
}
/**
* This event fires after {@link IGuiEventListener#keyReleased(int, int, int)} if the key was not already handled.
* This event fires after {@link GuiEventListener#keyReleased(int, int, int)} if the key was not already handled.
* Cancel this event when you successfully use the keyboard input to prevent other handlers from using the same input.
*/
@Cancelable
@@ -656,7 +657,7 @@ public class GuiScreenEvent extends Event
/**
* This event fires when keyboard character input is detected for a GuiScreen, before it is handled.
* Cancel this event to bypass {@link IGuiEventListener#charTyped(char, int)}.
* Cancel this event to bypass {@link GuiEventListener#charTyped(char, int)}.
*/
@Cancelable
public static class Pre extends KeyboardCharTypedEvent
@@ -668,7 +669,7 @@ public class GuiScreenEvent extends Event
}
/**
* This event fires after {@link IGuiEventListener#charTyped(char, int)} if the character was not already handled.
* This event fires after {@link GuiEventListener#charTyped(char, int)} if the character was not already handled.
* Cancel this event when you successfully use the keyboard input to prevent other handlers from using the same input.
*/
@Cancelable
@@ -19,10 +19,12 @@
package net.minecraftforge.client.event;
import com.mojang.blaze3d.platform.InputConstants;
import net.minecraft.client.KeyMapping;
import net.minecraft.world.InteractionHand;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;
import org.lwjgl.glfw.GLFW;
public class InputEvent extends Event
{
@@ -215,7 +217,7 @@ public class InputEvent extends Event
/**
* Platform-specific scan code.
* Used for {@link InputMappings#getInputByCode(int, int)}
* Used for {@link InputConstants#getKey(int, int)}
*
* The scan code is unique for every key, regardless of whether it has a key code.
* Scan codes are platform-specific but consistent over time, so keys will have different scan codes depending
@@ -25,7 +25,7 @@ import net.minecraftforge.event.entity.player.PlayerEvent;
/**
* This event is fired after player movement inputs are updated.<br>
* Handlers can freely manipulate {@link MovementInput} to cancel movement.<br>
* Handlers can freely manipulate {@link Input} to cancel movement.<br>
*/
public class InputUpdateEvent extends PlayerEvent
{
@@ -19,11 +19,14 @@
package net.minecraftforge.client.event;
import net.minecraft.client.particle.ParticleEngine;
import net.minecraft.client.particle.ParticleProvider;
import net.minecraft.core.particles.ParticleType;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.fml.event.IModBusEvent;
/**
* Fired when you should call {@link net.minecraft.client.particle.ParticleManager#registerFactory}.
* Fired when you should call {@link ParticleEngine#register(ParticleType, ParticleProvider)}.
* Note that your {@code ParticleType}s should still be registered during the usual registry events, this
* is only for the factories.
*/
@@ -20,6 +20,7 @@
package net.minecraftforge.client.event;
import net.minecraft.world.item.crafting.RecipeManager;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.Event;
/**
@@ -148,7 +148,7 @@ public class RenderGameOverlayEvent extends Event
}
/**
* @return The {@link ClientBossInfo} currently being rendered
* @return The {@link LerpingBossEvent} currently being rendered
*/
public LerpingBossEvent getBossInfo()
{
@@ -24,6 +24,7 @@ import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.world.entity.Entity;
import net.minecraft.network.chat.Component;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.EntityEvent;
import net.minecraftforge.eventbus.api.Event;
@@ -44,7 +45,7 @@ import net.minecraftforge.eventbus.api.Event;
* <br>
* This event has a result. {@link HasResult}. <br>
* ALLOW will force-render name plate/tag, DEFAULT will ignore the hook and continue using the vanilla check
* & DENY will prevent name plate/tag from rendering<br>
* and DENY will prevent name plate/tag from rendering<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@@ -35,7 +35,7 @@ import java.io.IOException;
*
* {@link #screenshotFile} contains the file the screenshot will be/was saved to
* {@link #image} contains the {@link NativeImage} that will be saved
* {@link #resultMessage} contains the {@link ITextComponent} to be returned. If {@code null}, the default vanilla message will be used instead
* {@link #resultMessage} contains the {@link Component} to be returned. If {@code null}, the default vanilla message will be used instead
*/
@Cancelable
public class ScreenshotEvent extends Event
@@ -30,7 +30,7 @@ public interface IForgeRenderChunk
* Extending classes can change the behavior of the cache, allowing to visually change
* blocks (schematics etc).
*
* @see RegionRenderCache
* @see RenderChunkRegion
* @param world The world to cache.
* @param from The starting position of the chunk minus one on each axis.
* @param to The ending position of the chunk plus one on each axis.
@@ -24,7 +24,7 @@ import com.mojang.math.Transformation;
import net.minecraft.client.resources.model.ModelState;
/**
* An {@link IModelTransform} that combines the transforms from two child {@link IModelTransform}.
* An {@link ModelState} that combines the transforms from two child {@link ModelState}.
*/
public class CompositeModelState implements ModelState
{
@@ -25,6 +25,7 @@ import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonObject;
import com.mojang.datafixers.util.Pair;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.block.model.ItemModelGenerator;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import com.mojang.blaze3d.vertex.VertexFormat;
import com.mojang.blaze3d.vertex.VertexFormatElement;
@@ -55,7 +56,7 @@ import net.minecraft.client.resources.model.UnbakedModel;
/**
* Forge reimplementation of vanilla {@link ItemModelGenerator}, i.e. builtin/generated models,
* with the following changes:
* - Represented as a true {@link IUnbakedModel} so it can be baked as usual instead of using
* - Represented as a true {@link UnbakedModel} so it can be baked as usual instead of using
* special-case logic like vanilla does.
* - Various fixes in the baking logic.
* - Not limited to 4 layers maximum.
@@ -44,7 +44,7 @@ public final class ItemTextureQuadConverter
* Takes a texture and converts it into BakedQuads.
* The conversion is done by scanning the texture horizontally and vertically and creating "strips" of the texture.
* Strips that are of the same size and follow each other are converted into one bigger quad.
* </br>
* <br/>
* The resulting list of quads is the texture represented as a list of horizontal OR vertical quads,
* depending on which creates less quads. If the amount of quads is equal, horizontal is preferred.
*
@@ -35,6 +35,7 @@ import net.minecraft.core.Direction;
import net.minecraft.util.GsonHelper;
import net.minecraft.resources.ResourceLocation;
import com.mojang.math.Transformation;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.geometry.IModelGeometry;
import net.minecraftforge.client.model.geometry.ISimpleModelGeometry;
import net.minecraftforge.client.model.obj.OBJLoader;
@@ -97,7 +98,7 @@ public class ModelLoaderRegistry
// Minecraft recreates the ModelBakery on resource reload, but this should only run once during init.
if (!registryFrozen)
{
net.minecraftforge.fml.ModLoader.get().postEvent(new net.minecraftforge.client.event.ModelRegistryEvent());
net.minecraftforge.fml.ModLoader.get().postEvent(new ModelRegistryEvent());
registryFrozen = true;
}
}
@@ -45,7 +45,7 @@ import net.minecraftforge.common.property.Properties;
import net.minecraftforge.common.util.LazyOptional;
/**
* Generic {@link TileGameRenderer} that works with the Forge model system and animations.
* Generic {@link BlockEntityRenderer} that works with the Forge model system and animations.
*/
public class AnimationBlockEntityRenderer<T extends BlockEntity> implements BlockEntityRenderer<T>, IEventHandler<T>
{
@@ -31,7 +31,7 @@ import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.core.Direction;
/**
* Convenience interface with default implementation of {@link IBakedModel#getQuads(net.minecraft.block.BlockState, net.minecraft.util.Direction, java.util.Random)}.
* Convenience interface with default implementation of {@link BakedModel#getQuads(BlockState, Direction, Random, IModelData)}.
*/
public interface IDynamicBakedModel extends BakedModel
{
@@ -93,7 +93,7 @@ public final class ConfiguredModel {
*
* @throws NullPointerException if {@code model} is {@code null}
* @throws IllegalArgumentException if x and/or y rotation are not valid (see
* {@link ModelRotation})
* {@link BlockModelRotation})
* @throws IllegalArgumentException if weight is less than or equal to zero
*/
public ConfiguredModel(ModelFile model, int rotationX, int rotationY, boolean uvLock, int weight) {
@@ -118,7 +118,7 @@ public final class ConfiguredModel {
*
* @throws NullPointerException if {@code model} is {@code null}
* @throws IllegalArgumentException if x and/or y rotation are not valid (see
* {@link ModelRotation})
* {@link BlockModelRotation})
*/
public ConfiguredModel(ModelFile model, int rotationX, int rotationY, boolean uvLock) {
this(model, rotationX, rotationY, uvLock, DEFAULT_WEIGHT);
@@ -228,7 +228,7 @@ public final class ConfiguredModel {
* @param value the x-rotation value
* @return this builder
* @throws IllegalArgumentException if {@code value} is not a valid x-rotation
* (see {@link ModelRotation})
* (see {@link BlockModelRotation})
*/
public Builder<T> rotationX(int value) {
checkRotation(value, rotationY);
@@ -242,7 +242,7 @@ public final class ConfiguredModel {
* @param value the y-rotation value
* @return this builder
* @throws IllegalArgumentException if {@code value} is not a valid y-rotation
* (see {@link ModelRotation})
* (see {@link BlockModelRotation})
*/
public Builder<T> rotationY(int value) {
checkRotation(rotationX, value);
@@ -137,7 +137,7 @@ public class VariantBlockStateBuilder implements IGeneratedBlockstate {
*
* @param state The {@link PartialBlockstate partial state} for which to set
* the models
* @param models A set of models to assign to this state
* @param model A set of models to assign to this state
* @return this builder
* @throws IllegalArgumentException if {@code state} has already been configured
* @see #addModels(PartialBlockstate, ConfiguredModel...)
@@ -38,7 +38,7 @@ import net.minecraft.client.resources.model.ModelState;
import net.minecraft.client.resources.model.UnbakedModel;
/**
* General interface for any model that can be baked, superset of vanilla {@link net.minecraft.client.renderer.model.IUnbakedModel}.
* General interface for any model that can be baked, superset of vanilla {@link UnbakedModel}.
* Models can be baked to different vertex formats and with different state.
*/
public interface IModelGeometry<T extends IModelGeometry<T>>
@@ -19,18 +19,20 @@
package net.minecraftforge.client.settings;
import net.minecraft.client.KeyMapping;
/**
* Defines the context that a {@link KeyBinding} is used.
* Key conflicts occur when a {@link KeyBinding} has the same {@link IKeyConflictContext} and has conflicting modifiers and keyCodes.
* Defines the context that a {@link KeyMapping} is used.
* Key conflicts occur when a {@link KeyMapping} has the same {@link IKeyConflictContext} and has conflicting modifiers and keyCodes.
*/
public interface IKeyConflictContext {
/**
* @return true if conditions are met to activate {@link KeyBinding}s with this context
* @return true if conditions are met to activate {@link KeyMapping}s with this context
*/
boolean isActive();
/**
* @return true if the other context can have {@link KeyBinding} conflicts with this one.
* @return true if the other context can have {@link KeyMapping} conflicts with this one.
* This will be called on both contexts to check for conflicts.
*/
boolean conflicts(IKeyConflictContext other);
@@ -20,6 +20,7 @@
package net.minecraftforge.client.settings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
public enum KeyConflictContext implements IKeyConflictContext
{
@@ -42,7 +43,7 @@ public enum KeyConflictContext implements IKeyConflictContext
},
/**
* Gui key bindings are only used when a {@link GuiScreen} is open.
* Gui key bindings are only used when a {@link Screen} is open.
*/
GUI {
@Override
@@ -59,7 +60,7 @@ public enum KeyConflictContext implements IKeyConflictContext
},
/**
* In-game key bindings are only used when a {@link GuiScreen} is not open.
* In-game key bindings are only used when a {@link Screen} is not open.
*/
IN_GAME {
@Override
@@ -40,7 +40,7 @@ import java.util.function.Predicate;
import java.util.stream.Collectors;
/**
* New implementation of {@link net.minecraft.advancements.PlayerAdvancements#ensureAllVisible()}
* New implementation of {@code PlayerAdvancements#ensureAllVisible()}
*/
public class AdvancementLoadFix {
private static final Logger LOGGER = LogManager.getLogger();
@@ -47,7 +47,7 @@ public class FarmlandWaterManager
/**
* Adds a custom ticket.
* Use {@link #addAABBTicket(World, AxisAlignedBB)} if you just need a ticket that can water a certain area.
* Use {@link #addAABBTicket(Level, AABB)} if you just need a ticket that can water a certain area.
* <br>
* If you don't want to water the region anymore, call {@link SimpleTicket#invalidate()}. Also call this
* when the region this is unloaded (e.g. your TE is unloaded or the block is removed), and validate once it is loaded
@@ -126,7 +126,7 @@ public class FarmlandWaterManager
}
/**
* Tests if a block is in a region that is watered by blocks. This does not check vanilla water, see {@link net.minecraft.block.FarmlandBlock#hasWater(IWorldReader, BlockPos)}
* Tests if a block is in a region that is watered by blocks. This does not check vanilla water, see {@code net.minecraft.world.level.block.FarmBlock#isNearWater(LevelReader, BlockPos)}
* @return true if there is a ticket with an AABB that includes your block
*/
public static boolean hasBlockWaterTicket(LevelReader world, BlockPos pos)
@@ -997,7 +997,7 @@ public class ForgeHooks
}
/**
* Hook to fire {@link ItemAttributeModifierEvent}. Modders should use {@link ItemStack#getAttributeModifiers(EquipmentSlotType)} instead.
* Hook to fire {@link ItemAttributeModifierEvent}. Modders should use {@link ItemStack#getAttributeModifiers(EquipmentSlot)} instead.
*/
public static Multimap<Attribute,AttributeModifier> getAttributeModifiers(ItemStack stack, EquipmentSlot equipmentSlot, Multimap<Attribute,AttributeModifier> attributes)
{
@@ -55,7 +55,7 @@ public interface IExtensibleEnum
default void init() {}
/**
* Use this instead of {@link IStringSerializable#createEnumCodec(Supplier, Function)} for extensible enums because this not cache the enum values on construction
* Use this instead of {@link StringRepresentable#fromEnum(Supplier, Function)} for extensible enums because this not cache the enum values on construction
*/
static <E extends Enum<E> & StringRepresentable> Codec<E> createCodecForExtensibleEnum(Supplier<E[]> valuesSupplier, Function<? super String, ? extends E> enumValueFromNameFunction) {
return StringRepresentable.fromStringResolver(Enum::ordinal, (id) -> valuesSupplier.get()[id], enumValueFromNameFunction);
@@ -19,6 +19,12 @@
package net.minecraftforge.common;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;
@@ -38,11 +44,11 @@ public final class PlantType
/**
* Getting a custom {@link PlantType}, or an existing one if it has the same name as that one. Your plant should implement {@link IPlantable}
* and return this custom type in {@link IPlantable#getPlantType(IBlockReader, BlockPos)}.
* and return this custom type in {@link IPlantable#getPlantType(BlockGetter, BlockPos)}.
*
* <p>If your new plant grows on blocks like any one of them above, never create a new {@link PlantType}.
* This Type is only functioning in
* {@link net.minecraft.block.Block#canSustainPlant(BlockState, IBlockReader, BlockPos, Direction, IPlantable)},
* {@link Block#canSustainPlant(BlockState, BlockGetter, BlockPos, Direction, IPlantable)},
* which you are supposed to override this function in your new block and create a new plant type to grow on that block.
*
* This method can be called during parallel loading
@@ -82,7 +82,7 @@ public class ToolActions
/**
* Used during player attack to figure out if a sweep attack should be performed
*
* @see {@link IForgeItem#getSweepHitBox}
* @see IForgeItem#getSweepHitBox
*/
public static final ToolAction SWORD_SWEEP = ToolAction.get("sword_sweep");
@@ -28,20 +28,20 @@ import java.lang.annotation.*;
* of 'Capability'
*
* Example:
* <pre>
* {@literal @}CapabilityInject(IExampleCapability.class)
* <pre>{@code
* @CapabilityInject(IExampleCapability.class)
* private static final Capability<IExampleCapability> TEST_CAP = null;
* </pre>
* }</pre>
*
* When placed on a METHOD, the method will be invoked once the
* capability is registered. This allows you to have a 'enable features'
* callback. It MUST have one parameter of type 'Capability;
*
* Example:
* <pre>
* {@literal @}CapabilityInject(IExampleCapability.class)
* <pre>{@code
* @CapabilityInject(IExampleCapability.class)
* private static void capRegistered(Capability<IExampleCapability> cap) {}
* </pre>
* }</pre>
*
* <b>Warning</b>: Capability injections are run in the thread that the capablity is registered.
* Due to parallel mod loading, this can potentially be off of the main thread.
@@ -30,8 +30,7 @@ package net.minecraftforge.common.capabilities;
* <pre>{@code
* public static Capability<IDataHolder> DATA_HOLDER_CAPABILITY
* = CapabilityManager.get(new CapabilityToken<>(){});
*
* </pre>
* }</pre>
*
*/
public abstract class CapabilityToken<T>
@@ -33,8 +33,8 @@ public interface ICapabilityProvider
* Modders are encouraged to cache this value, using the listener capabilities of the Optional to
* be notified if the requested capability get lost.
*
* @param capability The capability to check
* @param facing The Side to check from,
* @param cap The capability to check
* @param side The Side to check from,
* <strong>CAN BE NULL</strong>. Null is defined to represent 'internal' or 'self'
* @return The requested an optional holding the requested capability.
*/
@@ -64,10 +64,10 @@ public class EntitySelectorManager
}
/**
* This method is called in {@link EntitySelectorParser#parse} <br>
* This method is called in {@link EntitySelectorParser#parse()} <br>
*
* If the REGISTRY does not contain a custom selector for the command being parsed,
* this method returns {@code null} and the vanilla logic in {@link EntitySelectorParser#parseSelector} is used.
* this method returns {@code null} and the vanilla logic in {@code EntitySelectorParser#parseSelector()} is used.
*/
public static EntitySelector parseSelector(EntitySelectorParser parser) throws CommandSyntaxException
{
@@ -88,7 +88,7 @@ public class EntitySelectorManager
}
/**
* This method is called in {@link EntitySelectorParser#fillSelectorSuggestions}
* This method is called in {@code EntitySelectorParser#fillSelectorSuggestions(SuggestionsBuilder)}
*/
public static void fillSelectorSuggestions(SuggestionsBuilder suggestionBuilder)
{
@@ -24,6 +24,8 @@ import net.minecraft.commands.arguments.selector.EntitySelector;
import net.minecraft.commands.arguments.selector.EntitySelectorParser;
import net.minecraft.network.chat.Component;
import java.util.function.Predicate;
/**
* Implementations of this interface can be registered using {@link EntitySelectorManager#register}
*/
@@ -32,13 +34,13 @@ public interface IEntitySelectorType
/**
* Returns an {@link EntitySelector} based on the given {@link EntitySelectorParser}. <br>
*
* Use {@link EntitySelectorParser#getReader} to read extra arguments and {@link EntitySelectorParser#addFilter} to add the corresponding filters. <br>
* Use {@link EntitySelectorParser#getReader} to read extra arguments and {@link EntitySelectorParser#addPredicate(Predicate)} to add the corresponding filters. <br>
* If the token being parsed does not match the syntax of this selector, this method should throw an appropriate {@link CommandSyntaxException}.
*/
EntitySelector build(EntitySelectorParser parser) throws CommandSyntaxException;
/**
* Returns an {@link ITextComponent} containing a short description for this selector type.
* Returns an {@link Component} containing a short description for this selector type.
*/
Component getSuggestionTooltip();
}
@@ -19,6 +19,8 @@
package net.minecraftforge.common.crafting;
import net.minecraft.world.inventory.CraftingMenu;
import net.minecraft.world.inventory.InventoryMenu;
import net.minecraft.world.inventory.ResultContainer;
import net.minecraft.world.inventory.CraftingContainer;
@@ -31,15 +33,15 @@ public interface IRecipeContainer
{
/**
* The crafting result slot of your container, where you take out the crafted item.
* The equivalent for {@link ContainerWorkbench} is {@link ContainerWorkbench#craftResult}.
* The equivalent for {@link ContainerPlayer} is {@link ContainerPlayer#craftResult}.
* The equivalent for {@link CraftingMenu} is {@code CraftingMenu#resultSlots}.
* The equivalent for {@link InventoryMenu} is {@code InventoryMenu#resultSlots}.
*/
ResultContainer getCraftResult();
/**
* The crafting matrix of your container, where ingredients go for crafting.
* The equivalent for {@link ContainerWorkbench} is {@link ContainerWorkbench#craftMatrix}.
* The equivalent for {@link ContainerPlayer} is {@link ContainerPlayer#craftMatrix}.
* The equivalent for {@link CraftingMenu} is {@code CraftingMenu#craftSlots}.
* The equivalent for {@link InventoryMenu} is {@code InventoryMenu#craftSlots}.
*/
CraftingContainer getCraftMatrix();
}
@@ -30,6 +30,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Tuple;
import net.minecraftforge.common.loot.GlobalLootModifierSerializer;
import net.minecraftforge.common.loot.IGlobalLootModifier;
import net.minecraftforge.common.loot.LootModifier;
import java.io.IOException;
import java.nio.file.Path;
@@ -40,7 +41,7 @@ import java.util.Map;
import java.util.stream.Collectors;
/**
* Provider for forge's GlobalLootModifier system. See {@link net.minecraftforge.common.loot.LootModifier} and {@link GlobalLootModifierSerializer}.
* Provider for forge's GlobalLootModifier system. See {@link LootModifier} and {@link GlobalLootModifierSerializer}.
*
* This provider only requires implementing {@link #start()} and calling {@link #add} from it.
*/
@@ -103,7 +104,6 @@ public abstract class GlobalLootModifierProvider implements DataProvider
*
* @param modifier The name of the modifier, which will be the file name.
* @param serializer The serializer of this modifier.
* @param conditions The loot conditions before {@link LootModifier#doApply} is called.
*/
public <T extends IGlobalLootModifier> void add(String modifier, GlobalLootModifierSerializer<T> serializer, T instance)
{
@@ -23,6 +23,7 @@ import java.util.Optional;
import java.util.Set;
import javax.annotation.Nullable;
import net.minecraft.client.Camera;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.LivingEntity;
@@ -30,7 +31,9 @@ import net.minecraft.world.entity.SpawnPlacements;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
import net.minecraft.world.entity.boss.wither.WitherBoss;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.projectile.FishingHook;
import net.minecraft.world.entity.projectile.WitherSkull;
import net.minecraft.world.item.*;
import net.minecraft.world.level.block.*;
@@ -69,9 +72,9 @@ public interface IForgeBlock
* between 0 and 1.
* <p>
* Note that entities may reduce slipperiness by a certain factor of their own;
* for {@link net.minecraft.world.entity.LivingEntity}, this is {@code .91}.
* {@link net.minecraft.world.entity.item.ItemEntity} uses {@code .98}, and
* {@link net.minecraft.world.entity.projectile.FishingHook} uses {@code .92}.
* for {@link LivingEntity}, this is {@code .91}.
* {@link ItemEntity} uses {@code .98}, and
* {@link FishingHook} uses {@code .92}.
*
* @param state state of the block
* @param world the world
@@ -476,7 +479,7 @@ public interface IForgeBlock
/**
* Used to determine the state 'viewed' by an entity (see
* {@link ActiveRenderInfo#getBlockStateAtEntityViewpoint(World, Entity, float)}).
* {@link Camera#getBlockAtCamera()}).
* Can be used by fluid blocks to determine if the viewpoint is within the fluid or not.
*
* @param state the state
@@ -724,7 +727,7 @@ public interface IForgeBlock
* Whether redstone dust should visually connect to this block on a given side
* <p>
* The default implementation is identical to
* {@link RedStoneWireBlock#shouldConnectTo(BlockState, Direction)}
* {@code RedStoneWireBlock#shouldConnectTo(BlockState, Direction)}
*
* <p>
* {@link RedStoneWireBlock} updates its visual connection when
@@ -21,6 +21,9 @@ package net.minecraftforge.common.extensions;
import javax.annotation.Nonnull;
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.Blocks;
@@ -66,11 +69,11 @@ public interface IForgeBlockEntity extends ICapabilitySerializable<CompoundTag>
default void onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket pkt){ }
/**
* Called when the chunk's TE update tag, gotten from {@link #getUpdateTag()}, is received on the client.
* Called when the chunk's TE update tag, gotten from {@link BlockEntity#getUpdateTag()}, is received on the client.
* <p>
* Used to handle this tag in a special way. By default this simply calls {@link #readFromNBT(NBTTagCompound)}.
* Used to handle this tag in a special way. By default this simply calls {@link BlockEntity#load(CompoundTag)}.
*
* @param tag The {@link NBTTagCompound} sent from {@link #getUpdateTag()}
* @param tag The {@link CompoundTag} sent from {@link BlockEntity#getUpdateTag()}
*/
default void handleUpdateTag(CompoundTag tag)
{
@@ -78,7 +81,7 @@ public interface IForgeBlockEntity extends ICapabilitySerializable<CompoundTag>
}
/**
* Gets a {@link NBTTagCompound} that can be used to store custom data for this tile entity.
* Gets a {@link CompoundTag} that can be used to store custom data for this tile entity.
* It will be written, and read from disc, so it persists over world saves.
*
* @return A compound tag for custom data
@@ -98,16 +101,16 @@ public interface IForgeBlockEntity extends ICapabilitySerializable<CompoundTag>
}
/**
* Sometimes default render bounding box: infinite in scope. Used to control rendering on {@link TileEntitySpecialRenderer}.
* Sometimes default render bounding box: infinite in scope. Used to control rendering on {@link BlockEntityWithoutLevelRenderer}.
*/
public static final AABB INFINITE_EXTENT_AABB = new net.minecraft.world.phys.AABB(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);
/**
* Return an {@link AxisAlignedBB} that controls the visible scope of a {@link TileEntitySpecialRenderer} associated with this {@link TileEntity}
* Defaults to the collision bounding box {@link Block#getCollisionBoundingBoxFromPool(World, int, int, int)} associated with the block
* Return an {@link AABB} that controls the visible scope of a {@link BlockEntityWithoutLevelRenderer} associated with this {@link BlockEntity}
* Defaults to the collision bounding box {@link BlockState#getCollisionShape(BlockGetter, BlockPos)} associated with the block
* at this location.
*
* @return an appropriately size {@link AxisAlignedBB} for the {@link TileEntity}
* @return an appropriately size {@link AABB} for the {@link BlockEntity}
*/
default AABB getRenderBoundingBox()
{
@@ -169,7 +172,7 @@ public interface IForgeBlockEntity extends ICapabilitySerializable<CompoundTag>
/**
* Allows you to return additional model data.
* This data can be used to provide additional functionality in your {@link net.minecraft.client.renderer.model.IBakedModel}
* This data can be used to provide additional functionality in your {@link BakedModel}
* You need to schedule a refresh of you model data via {@link #requestModelDataUpdate()} if the result of this function changes.
* <b>Note that this method may be called on a chunk render thread instead of the main client thread</b>
* @return Your model data
@@ -22,12 +22,15 @@ package net.minecraftforge.common.extensions;
import java.util.Optional;
import javax.annotation.Nullable;
import net.minecraft.client.Camera;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.SpawnPlacements.Type;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.projectile.FishingHook;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.pathfinder.BlockPathTypes;
@@ -61,9 +64,9 @@ public interface IForgeBlockState
* between 0 and 1.
* <p>
* Note that entities may reduce slipperiness by a certain factor of their own;
* for {@link net.minecraft.entity.LivingEntity}, this is {@code .91}.
* {@link net.minecraft.entity.item.ItemEntity} uses {@code .98}, and
* {@link net.minecraft.entity.projectile.FishingBobberEntity} uses {@code .92}.
* for {@link LivingEntity}, this is {@code .91}.
* {@link ItemEntity} uses {@code .98}, and
* {@link FishingHook} uses {@code .92}.
*
* @param world the world
* @param pos the position in the world
@@ -247,7 +250,7 @@ public interface IForgeBlockState
}
/**
* Allows a block to override the standard vanilla running particles.
* This is called from {@link Entity#handleRunningEffect} and is called both,
* This is called from {@code Entity#spawnSprintParticle()} and is called both,
* Client and server side, it's up to the implementor to client check / server check.
* By default vanilla spawns particles only on the client and the server methods no-op.
*
@@ -413,7 +416,7 @@ public interface IForgeBlockState
/**
* Used to determine the state 'viewed' by an entity (see
* {@link net.minecraft.client.Camera#getBlockAtCamera()}).
* {@link Camera#getBlockAtCamera()}).
* Can be used by fluid blocks to determine if the viewpoint is within the fluid or not.
*
* @param world the world
@@ -621,7 +624,7 @@ public interface IForgeBlockState
* @param pos The block position in world
* @param player The player clicking the block
* @param stack The stack being used by the player
* @param toolType The tool type to be considered when performing the action
* @param toolAction The tool type to be considered when performing the action
* @return The resulting state after the action has been performed
*/
@Nullable
@@ -21,6 +21,9 @@ package net.minecraftforge.common.extensions;
import java.util.Collection;
import javax.annotation.Nullable;
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.MobCategory;
@@ -141,8 +144,7 @@ public interface IForgeEntity extends ICapabilitySerializable<CompoundTag>
/**
* Gets whether this entity has been added to a world (for tracking). Specifically
* between the times when an entity is added to a world and the entity being removed
* from the world's tracked lists. See {@link World#onEntityAdded(Entity)} and
* {@link World#onEntityRemoved(Entity)}.
* from the world's tracked lists.
*
* @return True if this entity is being tracked by a world
*/
@@ -173,7 +175,7 @@ public interface IForgeEntity extends ICapabilitySerializable<CompoundTag>
/**
* This is used to specify that your entity has multiple individual parts, such as the Vanilla Ender Dragon.
*
* See {@link net.minecraft.entity.boss.dragon.EnderDragonEntity} for an example implementation.
* See {@link EnderDragon} for an example implementation.
* @return true if this is a multipart entity.
*/
default boolean isMultipartEntity()
@@ -190,7 +192,7 @@ public interface IForgeEntity extends ICapabilitySerializable<CompoundTag>
*
* Only used if {@link #isMultipartEntity()} returns true.
*
* See {@link net.minecraft.entity.boss.dragon.EnderDragonEntity} for an example implementation.
* See {@link EnderDragon} for an example implementation.
* @return The child parts of this entity. The value to be returned here should be cached.
*/
@Nullable
@@ -28,6 +28,7 @@ import javax.annotation.Nullable;
import com.google.common.collect.Multimap;
import net.minecraft.world.item.*;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.level.block.Blocks;
@@ -52,6 +53,7 @@ import net.minecraft.network.chat.Component;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.ToolAction;
import net.minecraftforge.common.ToolActions;
import net.minecraftforge.registries.IForgeRegistryEntry;
// TODO review most of the methods in this "patch"
public interface IForgeItem
@@ -374,7 +376,7 @@ public interface IForgeItem
/**
* Override this to set a non-default armor slot for an ItemStack, but <em>do
* not use this to get the armor slot of said stack; for that, use
* {@link net.minecraft.world.entity.LivingEntity#getEquipmentSlotForItem(ItemStack)}..</em>
* {@link LivingEntity#getEquipmentSlotForItem(ItemStack)}..</em>
*
* @param stack the ItemStack
* @return the armor slot of the ItemStack, or {@code null} to let the default
@@ -501,7 +503,7 @@ public interface IForgeItem
/**
* Return if this itemstack is damaged. Note only called if
* {@link #isDamageable()} is true.
* {@link ItemStack#isDamageableItem()} is true.
*
* @param stack the stack
* @return if the stack is damaged
@@ -525,7 +527,7 @@ public interface IForgeItem
/**
* Queries if an item can perform the given action.
* See {@link net.minecraftforge.common.ToolActions} for a description of each stock action
* See {@link ToolActions} for a description of each stock action
* @param stack The stack being used
* @param toolAction The action being queried
* @return True if the stack can perform the action
@@ -537,7 +539,7 @@ public interface IForgeItem
}
/**
* ItemStack sensitive version of {@link #canHarvestBlock(IBlockState)}
* ItemStack sensitive version of {@link Item#isCorrectToolForDrops(BlockState)}
*
* @param stack The itemstack used to harvest the block
* @param state The block trying to harvest
@@ -577,7 +579,7 @@ public interface IForgeItem
* applies specifically to enchanting an item in the enchanting table and is
* called when retrieving the list of possible enchantments for an item.
* Enchantments may additionally (or exclusively) be doing their own checks in
* {@link net.minecraft.enchantment.Enchantment#canApplyAtEnchantingTable(ItemStack)};
* {@link Enchantment#canApplyAtEnchantingTable(ItemStack)};
* check the individual implementation for reference. By default this will check
* if the enchantment type is valid for this item type.
*
@@ -585,7 +587,7 @@ public interface IForgeItem
* @param enchantment the enchantment to be applied
* @return true if the enchantment can be applied to this item
*/
default boolean canApplyAtEnchantingTable(ItemStack stack, net.minecraft.world.item.enchantment.Enchantment enchantment)
default boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment)
{
return enchantment.category.canEnchant(stack.getItem());
}
@@ -646,7 +648,7 @@ public interface IForgeItem
*
* @param itemStack the ItemStack to check
* @return the Mod ID for the ItemStack, or null when there is no specially
* associated mod and {@link #getRegistryName()} would return null.
* associated mod and {@link IForgeRegistryEntry#getRegistryName()} would return null.
*/
@Nullable
default String getCreatorModId(ItemStack itemStack)
@@ -689,7 +691,7 @@ public interface IForgeItem
* @param shield The shield in question
* @param entity The LivingEntity holding the shield
* @param attacker The LivingEntity holding the ItemStack
* @retrun True if this ItemStack can disable the shield in question.
* @return True if this ItemStack can disable the shield in question.
*/
default boolean canDisableShield(ItemStack stack, ItemStack shield, LivingEntity entity, LivingEntity attacker)
{
@@ -722,7 +724,7 @@ public interface IForgeItem
}
/**
* Called every tick from {@link EntityHorse#onUpdate()} on the item in the
* Called every tick from {@code Horse#playGallopSound(SoundEvent)} on the item in the
* armor slot.
*
* @param stack the armor itemstack
@@ -810,7 +812,7 @@ public interface IForgeItem
/**
* Get a bounding box ({@link AABB}) of a sweep attack.
*
* @param statck the stack held by the player.
* @param stack the stack held by the player.
* @param player the performing the attack the attack.
* @param target the entity targeted by the attack.
* @return the bounding box.
@@ -115,8 +115,7 @@ public interface IForgeItemStack extends ICapabilitySerializable<CompoundTag>
/**
* Queries if an item can perform the given action.
* See {@link net.minecraftforge.common.ToolActions} for a description of each stock action
* @param stack The stack being used
* See {@link ToolActions} for a description of each stock action
* @param toolAction The action being queried
* @return True if the stack can perform the action
*/
@@ -157,7 +156,7 @@ public interface IForgeItemStack extends ICapabilitySerializable<CompoundTag>
* applies specifically to enchanting an item in the enchanting table and is
* called when retrieving the list of possible enchantments for an item.
* Enchantments may additionally (or exclusively) be doing their own checks in
* {@link net.minecraft.enchantment.Enchantment#canApplyAtEnchantingTable(ItemStack)};
* {@link Enchantment#canApplyAtEnchantingTable(ItemStack)};
* check the individual implementation for reference. By default this will check
* if the enchantment type is valid for this item type.
*
@@ -182,7 +181,7 @@ public interface IForgeItemStack extends ICapabilitySerializable<CompoundTag>
/**
* Override this to set a non-default armor slot for an ItemStack, but <em>do
* not use this to get the armor slot of said stack; for that, use
* {@link net.minecraft.world.entity.LivingEntity#getEquipmentSlotForItem(ItemStack)}.</em>
* {@link LivingEntity#getEquipmentSlotForItem(ItemStack)}.</em>
*
* @return the armor slot of the ItemStack, or {@code null} to let the default
* vanilla logic as per {@code LivingEntity.getSlotForItemStack(stack)}
@@ -200,7 +199,7 @@ public interface IForgeItemStack extends ICapabilitySerializable<CompoundTag>
* @param shield The shield in question
* @param entity The LivingEntity holding the shield
* @param attacker The LivingEntity holding the ItemStack
* @retrun True if this ItemStack can disable the shield in question.
* @return True if this ItemStack can disable the shield in question.
*/
default boolean canDisableShield(ItemStack shield, LivingEntity entity, LivingEntity attacker)
{
@@ -287,7 +286,7 @@ public interface IForgeItemStack extends ICapabilitySerializable<CompoundTag>
}
/**
* Called every tick from {@link HorseEntity#onUpdate()} on the item in the
* Called every tick from {@code Horse#playGallopSound(SoundEvent)} on the item in the
* armor slot.
*
* @param world the world the horse is in
@@ -36,7 +36,7 @@ public interface IForgeMobEffect
/**
* Get a fresh list of items that can cure this Potion.
* All new PotionEffects created from this Potion will call this to initialize the default curative items
* @see PotionEffect#getCurativeItems
* @see MobEffectInstance#getCurativeItems()
* @return A list of items that can cure this Potion
*/
default List<ItemStack> getCurativeItems() {
@@ -21,6 +21,7 @@ package net.minecraftforge.common.extensions;
import java.util.List;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
@@ -31,7 +32,7 @@ public interface IForgeMobEffectInstance
/***
* Returns a list of curative items for the potion effect
* By default, this list is initialized using {@link Potion#getCurativeItems}
* By default, this list is initialized using {@link MobEffect#getCurativeItems()}
*
* @return The list (ItemStack) of curative items for the potion effect
*/
@@ -52,7 +52,7 @@ public interface IForgeRawTagBuilder
/**
* Adds a tag entry to the remove list.
* @param entry The tag entry to add to the remove list
* @param tagEntry The tag entry to add to the remove list
* @param source The source of the caller for logging purposes (generally a modid)
* @return The builder for chaining purposes
*/
@@ -49,11 +49,11 @@ public interface IForgeStructureFeature
}
/**
* Gets the default list of {@link EntityClassification#MONSTER} spawns for this structure.
* Gets the default list of {@link MobCategory#MONSTER} spawns for this structure.
*
* @apiNote Implement this over {@link Structure#getSpawnList()}
* @apiNote Implement this over {@link StructureFeature#getSpecialEnemies()}
*
* @Deprecated Use {@link IForgeStructureFeature#getDefaultSpawnList(MobCategory)}
* @deprecated Use {@link IForgeStructureFeature#getDefaultSpawnList(MobCategory)}
* TODO: Remove in 1.18
*/
default List<MobSpawnSettings.SpawnerData> getDefaultSpawnList()
@@ -62,11 +62,11 @@ public interface IForgeStructureFeature
}
/**
* Gets the default list of {@link EntityClassification#CREATURE} spawns for this structure.
* Gets the default list of {@link MobCategory#CREATURE} spawns for this structure.
*
* @apiNote Implement this over {@link Structure#getCreatureSpawnList()}
* @apiNote Implement this over {@link StructureFeature#getSpecialAnimals()}
*
* @Deprecated Use {@link IForgeStructureFeature#getDefaultSpawnList(MobCategory)}
* @deprecated Use {@link IForgeStructureFeature#getDefaultSpawnList(MobCategory)}
* TODO: Remove in 1.18
*/
default List<MobSpawnSettings.SpawnerData> getDefaultCreatureSpawnList()
@@ -88,7 +88,7 @@ public interface IForgeStructureFeature
/**
* Helper method to get the list of entity spawns for this structure for the given classification.
* @param classification The classification of entities.
* @apiNote This method is marked as final in {@link Structure} so as to not be overridden by modders and breaking support for
* @apiNote This method is marked as final in {@link StructureFeature} so as to not be overridden by modders and breaking support for
* {@link net.minecraftforge.event.world.StructureSpawnListGatherEvent}.
*/
WeightedRandomList<MobSpawnSettings.SpawnerData> getSpawnList(MobCategory classification);
@@ -68,7 +68,7 @@ public interface IForgeTagAppender<T>
/**
* Adds a registry entry to the tag json's remove list. Callable during datageneration.
* @param element The entry to remove
* @param entry The entry to remove
* @return The builder for chaining
*/
default TagsProvider.TagAppender<T> remove(final T entry)
@@ -59,9 +59,9 @@ public abstract class GlobalLootModifierSerializer<T extends IGlobalLootModifier
* Most mods will likely not need more than<br/>
* <code>return new MyModifier(conditionsIn)</code><br/>
* but any additional properties that are needed will need to be deserialized here.
* @param name The resource location (if needed)
* @param json The full json object (including ILootConditions)
* @param conditionsIn An already deserialized list of ILootConditions
* @param location The resource location (if needed)
* @param object The full json object (including ILootConditions)
* @param ailootcondition An already deserialized list of ILootConditions
*/
public abstract T read(ResourceLocation location, JsonObject object, LootItemCondition[] ailootcondition);
@@ -48,7 +48,7 @@ public interface IAnimationStateMachine
/**
* Set to true if the machine should handle special events that come from the clips (they start with '!').
* Right now only implemented event is "!transition:<state_name>".
* Right now only implemented event is {@literal "!transition:<state_name>"}.
* Default value is true.
*/
void shouldHandleSpecialEvents(boolean value);
@@ -19,9 +19,22 @@
package net.minecraftforge.common.util;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.Tag;
import net.minecraft.nbt.TagType;
import net.minecraft.nbt.TagTypes;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.LevelWriter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.LevelEvent;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.LevelChunk;
/**
* A class containing constants for magic numbers used in the minecraft codebase.
@@ -34,10 +47,10 @@ import net.minecraft.world.level.block.LevelEvent;
public class Constants
{
/**
* NBT Tag type IDS, used when storing the nbt to disc, Should align with {@link net.minecraft.nbt.INBT#create}
* and {@link net.minecraft.nbt.INBT#getTypeName}
* NBT Tag type IDS, used when storing the nbt to disc, Should align with {@link TagTypes#getType(int)}
* and {@link TagType#getPrettyName()}
*
* Main use is checking tag type in {@link net.minecraft.nbt.CompoundNBT#contains(String, int)}
* Main use is checking tag type in {@link CompoundTag#contains(String, int)}
*
* @deprecated Replaced by the constants in {@link net.minecraft.nbt.Tag}.
* TODO Remove in 1.18
@@ -62,8 +75,8 @@ public class Constants
}
/**
* The world event IDS, used when calling {@link IWorld#playEvent(int, BlockPos, int)}. <br>
* Can be found from {@link net.minecraft.client.renderer.WorldRenderer#playEvent}<br>
* The world event IDS, used when calling {@link Level#globalLevelEvent(int, BlockPos, int)}. <br>
* Can be found from {@link LevelRenderer#globalLevelEvent(int, BlockPos, int)}<br>
* Some of the events use the {@code data} parameter. If this is the case, an explanation of what {@code data} does is also provided
*
* @deprecated Replaced by the constants in {@link net.minecraft.world.level.block.LevelEvent}.
@@ -128,12 +141,12 @@ public class Constants
public static final int REDSTONE_TORCH_BURNOUT = LevelEvent.REDSTONE_TORCH_BURNOUT;
public static final int END_PORTAL_FRAME_FILL = LevelEvent.END_PORTAL_FRAME_FILL;
/**
* {@code data} is the {@link Direction#getIndex()} of the direction the smoke is to come out of.
* {@code data} is the {@link Direction#get3DDataValue()} of the direction the smoke is to come out of.
*/
public static final int DISPENSER_SMOKE = LevelEvent.PARTICLES_SHOOT;
/**
* {@code data} is the {@link net.minecraft.block.Block#getStateId state id} of the block broken
* {@code data} is the {@link Block#getId(BlockState)} state id} of the block broken
*/
public static final int BREAK_BLOCK_EFFECTS = LevelEvent.PARTICLES_DESTROY_BLOCK;
/**
@@ -161,10 +174,10 @@ public class Constants
/**
* The flags used when calling
* {@link net.minecraft.world.IWorldWriter#setBlockState(BlockPos, BlockState, int)}<br>
* Can be found from {@link World#setBlockState(BlockPos, BlockState, int)},
* {@link World#markAndNotifyBlock}, and
* {@link WorldRenderer#notifyBlockUpdate}<br>
* {@link LevelWriter#setBlock(BlockPos, BlockState, int)}<br>
* Can be found from {@link Level#setBlock(BlockPos, BlockState, int)} ,
* {@link Level#markAndNotifyBlock(BlockPos, LevelChunk, BlockState, BlockState, int, int)}, and
* {@link LevelRenderer#blockChanged(BlockGetter, BlockPos, BlockState, BlockState, int)}<br>
* Flags can be combined with bitwise OR
*
* @deprecated Replaced by the constants in {@link net.minecraft.world.level.block.Block}.
@@ -173,13 +186,12 @@ public class Constants
@Deprecated(since = "1.17", forRemoval = true)
public static class BlockFlags {
/**
* Calls
* {@link Block#neighborChanged(BlockState, World, BlockPos, Block, BlockPos, boolean)
* Calls {@link Block#neighborChanged(BlockState, Level, BlockPos, Block, BlockPos, boolean)
* neighborChanged} on surrounding blocks (with isMoving as false). Also updates comparator output state.
*/
public static final int NOTIFY_NEIGHBORS = Block.UPDATE_NEIGHBORS;
/**
* Calls {@link World#notifyBlockUpdate(BlockPos, BlockState, BlockState, int)}.<br>
* Calls {@link Level#sendBlockUpdated(BlockPos, BlockState, BlockState, int)}.<br>
* Server-side, this updates all the path-finding navigators.
*/
public static final int BLOCK_UPDATE = Block.UPDATE_CLIENTS;
@@ -195,23 +207,22 @@ public class Constants
/**
* Causes neighbor updates to be sent to all surrounding blocks (including
* diagonals). This in turn will call
* {@link Block#updateDiagonalNeighbors(BlockState, IWorld, BlockPos, int)
* updateDiagonalNeighbors} on both old and new states, and
* {@link Block#updateNeighbors(BlockState, IWorld, BlockPos, int)
* updateNeighbors} on the new state.
* {@link Block#updateIndirectNeighbourShapes(BlockState, LevelAccessor, BlockPos, int, int)}
* on both old and new states, and
* {@link Block#updateOrDestroy(BlockState, BlockState, LevelAccessor, BlockPos, int, int)} on the new state.
*/
public static final int UPDATE_NEIGHBORS = Block.UPDATE_KNOWN_SHAPE;
/**
* Prevents neighbor changes from spawning item drops, used by
* {@link Block#replaceBlock(BlockState, BlockState, IWorld, BlockPos, int)}.
* {@link Block#updateOrDestroy(BlockState, BlockState, LevelAccessor, BlockPos, int)}.
*/
public static final int NO_NEIGHBOR_DROPS = Block.UPDATE_SUPPRESS_DROPS;
/**
* Tell the block being changed that it was moved, rather than removed/replaced,
* the boolean value is eventually passed to
* {@link Block#onReplaced(BlockState, World, BlockPos, BlockState, boolean)}
* {@link Block#onRemove(BlockState, Level, BlockPos, BlockState, boolean)}
* as the last parameter.
*/
public static final int IS_MOVING = Block.UPDATE_MOVE_BY_PISTON;
@@ -19,8 +19,11 @@
package net.minecraftforge.common.util;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.sounds.SoundEvent;
import net.minecraftforge.fmllegacy.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import javax.annotation.Nonnull;
import java.util.function.Supplier;
@@ -23,6 +23,7 @@ import java.util.function.Function;
import javax.annotation.Nullable;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.portal.PortalInfo;
import net.minecraft.world.entity.Entity;
import net.minecraft.server.level.ServerPlayer;
@@ -36,7 +37,7 @@ import net.minecraft.server.level.ServerLevel;
* An implementation of this interface can be used to place the entity
* in a safe location, or generate a return portal, for instance.
* <p>
* See the {@link net.minecraft.world.Teleporter} class, which has
* See the {@link PortalForcer} class, which has
* been patched to implement this interface, for a vanilla example.
*/
public interface ITeleporter
@@ -57,7 +58,7 @@ public interface ITeleporter
* @param yaw the suggested yaw value to apply
* @param repositionEntity a function to reposition the entity, which returns the new entity in the new dimension. This is the vanilla implementation of the dimension travel logic. If the supplied boolean is true, it is attempted to spawn a new portal.
*
* @return the entity in the new World. Vanilla creates for most {@link Entity}s a new instance and copy the data. But <b>you are not allowed</b> to create a new instance for {@link PlayerEntity}s! Move the player and update its state, see {@link ServerPlayerEntity#changeDimension(net.minecraft.world.server.ServerWorld, ITeleporter)}
* @return the entity in the new World. Vanilla creates for most {@link Entity}s a new instance and copy the data. But <b>you are not allowed</b> to create a new instance for {@link Player}s! Move the player and update its state, see {@link ServerPlayer#changeDimension(ServerLevel, ITeleporter)}
*/
default Entity placeEntity(Entity entity, ServerLevel currentWorld, ServerLevel destWorld, float yaw, Function<Boolean, Entity> repositionEntity)
{
@@ -29,6 +29,7 @@ import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import net.minecraft.MethodsReturnNonnullByDefault;
import net.minecraftforge.common.capabilities.Capability;
import org.apache.commons.lang3.mutable.Mutable;
import org.apache.commons.lang3.mutable.MutableObject;
import org.apache.logging.log4j.Level;
@@ -20,6 +20,7 @@
package net.minecraftforge.common.util;
import javax.annotation.Nonnull;
import java.util.function.Consumer;
/**
* Equivalent to {@link Consumer}, except with nonnull contract.
@@ -20,6 +20,7 @@
package net.minecraftforge.common.util;
import javax.annotation.Nonnull;
import java.util.function.Function;
/**
* Equivalent to {@link Function}, except with nonnull contract.
@@ -20,6 +20,7 @@
package net.minecraftforge.common.util;
import javax.annotation.Nonnull;
import java.util.function.Predicate;
/**
* Equivalent to {@link Predicate}, except with nonnull contract.
@@ -20,6 +20,7 @@
package net.minecraftforge.common.util;
import javax.annotation.Nonnull;
import java.util.function.Supplier;
/**
* Equivalent to {@link Supplier}, except with nonnull contract.
@@ -24,6 +24,7 @@ import net.minecraft.util.profiling.ProfilerFiller;
import net.minecraft.server.ServerResources;
import net.minecraft.server.packs.resources.PreparableReloadListener;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.fml.ModLoader;
@@ -35,7 +36,7 @@ import java.util.concurrent.Executor;
import net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier;
/**
* The main ResourceManager is recreated on each reload, through {@link DataPackRegistries}'s creation.
* The main ResourceManager is recreated on each reload, through {@link ServerResources}'s creation.
*
* 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}
@@ -20,6 +20,7 @@
package net.minecraftforge.event;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AnvilMenu;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;
@@ -29,7 +30,7 @@ import javax.annotation.Nullable;
/**
*
* AnvilUpdateEvent is fired when the inputs (either input stack, or the name) to an anvil are changed. <br>
* It is called from {@link RepairContainer#updateRepairOutput}. <br>
* It is called from {@link AnvilMenu#createResult()}. <br>
* If the event is canceled, vanilla behavior will not run, and the output will be set to {@link ItemStack#EMPTY}. <br>
* If the event is not canceled, but the output is not empty, it will set the output and not run vanilla behavior. <br>
* if the output is empty, and the event is not canceled, vanilla behavior will execute. <br>
@@ -21,12 +21,14 @@ package net.minecraftforge.event;
import com.mojang.brigadier.ParseResults;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;
/**
* CommandEvent is fired after a command is parsed, but before it is executed.
* This event is fired during the invocation of {@link Commands#handleCommand(CommandSource, String)}. <br>
* This event is fired during the invocation of {@link Commands#performCommand(CommandSourceStack, String)}. <br>
* <br>
* {@link #parse} contains the instance of {@link ParseResults} for the parsed command.<br>
* {@link #exception} begins null, but can be populated with an exception to be thrown within the command.<br>
@@ -20,12 +20,14 @@
package net.minecraftforge.event;
import net.minecraft.world.Difficulty;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Event;
/**
* DifficultyChangeEvent is fired when difficulty is changing. <br>
* <br>
* This event is fired via the {@link ForgeHooks#onDifficultyChange(EnumDifficulty, EnumDifficulty)}.<br>
* This event is fired via the {@link ForgeHooks#onDifficultyChange(Difficulty, Difficulty)}.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
@@ -20,6 +20,8 @@
package net.minecraftforge.event;
import com.mojang.brigadier.CommandDispatcher;
import net.minecraft.server.ServerResources;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Event;
@@ -27,8 +29,8 @@ import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
/**
* Commands are rebuilt whenever {@link DataPackRegistries} is recreated.
* You can use this event to register your commands whenever the {@link net.minecraft.command.Commands} class in constructed.
* Commands are rebuilt whenever {@link ServerResources} is recreated.
* You can use this event to register your commands whenever the {@link Commands} class in constructed.
*
* The event is fired on the {@link MinecraftForge#EVENT_BUS}
*/
@@ -23,6 +23,7 @@ import java.util.Collection;
import java.util.stream.Collectors;
import net.minecraftforge.fml.event.IModBusEvent;
import net.minecraftforge.registries.RegistryBuilder;
import org.apache.commons.lang3.Validate;
import com.google.common.collect.ImmutableList;
@@ -42,7 +43,7 @@ public class RegistryEvent<T extends IForgeRegistryEntry<T>> extends GenericEven
super(clazz);
}
/**
* Register new registries when you receive this event, through the {@link RecipeBuilder}
* Register new registries when you receive this event, through the {@link RegistryBuilder}
*/
public static class NewRegistry extends net.minecraftforge.eventbus.api.Event implements IModBusEvent
{
@@ -19,14 +19,18 @@
package net.minecraftforge.event;
import net.minecraft.network.protocol.game.ServerboundChatPacket;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.network.chat.Component;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
/**
* ServerChatEvent is fired whenever a C01PacketChatMessage is processed. <br>
* This event is fired via {@link ForgeHooks#onServerChatEvent(NetHandlerPlayServer, String, ITextComponent)},
* which is executed by the {@link NetHandlerPlayServer#processChatMessage(CPacketChatMessage)}<br>
* This event is fired via {@link ForgeHooks#onServerChatEvent(ServerGamePacketListenerImpl, String, Component)},
* which is executed by the {@link ServerGamePacketListenerImpl#handleChat(ServerboundChatPacket)}<br>
* <br>
* {@link #username} contains the username of the player sending the chat message.<br>
* {@link #message} contains the message being sent.<br>
@@ -26,7 +26,7 @@ import net.minecraftforge.eventbus.api.Event;
/**
* Fired on the client when :
* {@link TagContainer} has all of its tags synced from the server to the client (just after a client has connected).
* The integrated server is about to be created see {@link net.minecraft.client.Minecraft#doLoadLevel}
* The integrated server is about to be created see {@code net.minecraft.client.Minecraft#doLoadLevel}
* Fired on the server when {@link TagContainer} has read all tags from disk, during initial load and after the reload command is used
* This event is fired on the {@link MinecraftForge#EVENT_BUS}
* On the client, this event fires on the Client Thread.
@@ -21,12 +21,12 @@ package net.minecraftforge.event.brewing;
import net.minecraft.world.item.ItemStack;
import net.minecraft.core.NonNullList;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;
import javax.annotation.Nonnull;
public class PotionBrewEvent extends Event
{
private NonNullList<ItemStack> stacks;
@@ -60,7 +60,7 @@ public class PotionBrewEvent extends Event
* PotionBrewEvent.Pre is fired before vanilla brewing takes place.
* All changes made to the event's array will be made to the TileEntity if the event is canceled.
* <br>
* The event is fired during the {@link BrewingStandTileEntity#brewPotions()} method invocation.<br>
* The event is fired during the {@code BrewingStandBlockEntity#doBrew(Level, BlockPos, NonNullList)} method invocation.<br>
* <br>
* {@link #stacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.<br>
* <br>
@@ -85,7 +85,7 @@ public class PotionBrewEvent extends Event
/**
* PotionBrewEvent.Post is fired when a potion is brewed in the brewing stand.
* <br>
* The event is fired during the {@link BrewingStandTileEntity#brewPotions()} method invocation.<br>
* The event is fired during the {@code BrewingStandBlockEntity#doBrew(Level, BlockPos, NonNullList)} method invocation.<br>
* <br>
* {@link #stacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.<br>
* <br>
@@ -23,6 +23,8 @@ import net.minecraft.core.SectionPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityDimensions;
import net.minecraft.world.entity.Pose;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;
/**
@@ -69,7 +71,7 @@ public class EntityEvent extends Event
/**
* CanUpdate is fired when an Entity is being created. <br>
* This event is fired whenever vanilla Minecraft determines that an entity<br>
* cannot update in {@link World#updateEntityWithOptionalForce(net.minecraft.entity.Entity, boolean)} <br>
* cannot update in {@code World#updateEntityWithOptionalForce(net.minecraft.entity.Entity, boolean)} <br>
* <br>
* {@link CanUpdate#canUpdate} contains the boolean value of whether this entity can update.<br>
* If the modder decides that this Entity can be updated, they may change canUpdate to true, <br>
@@ -21,12 +21,20 @@ package net.minecraftforge.event.entity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.chunk.ChunkStatus;
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
/**
* EntityJoinWorldEvent is fired when an Entity joins the world. <br>
* This event is fired whenever an Entity is added to the world in
* {@link World#loadEntities(Collection)}, {@link net.minecraft.world.ServerWorld#loadEntities(Collection)} {@link World#joinEntityInSurroundings(Entity)}, and {@link World#spawnEntity(Entity)}. <br>
* <strong>Note:</strong> This event may be called before the underlying {@link net.minecraft.world.chunk.Chunk} is promoted to {@link net.minecraft.world.chunk.ChunkStatus#FULL}. You will cause chunk loading deadlocks if you don't delay your world interactions.<br>
* {@code Level#loadEntities(Collection)},
* {@code net.minecraft.world.ServerWorld#loadEntities(Collection)}
* {@code World#joinEntityInSurroundings(Entity)}, and
* {@code World#spawnEntity(Entity)}. <br>
* <strong>Note:</strong> This event may be called before the underlying {@link LevelChunk} is promoted to {@link ChunkStatus#FULL}.
* You will cause chunk loading deadlocks if you don't delay your world interactions.<br>
* <br>
* {@link #world} contains the world in which the entity is to join.<br>
* <br>
@@ -19,13 +19,17 @@
package net.minecraftforge.event.entity;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
/**
* EntityLeaveWorldEvent is fired when an Entity leaves the world. <br>
* This event is fired whenever an Entity is removed from the world in
* {@link ClientWorld#removeEntity(Entity)}, {@link ServerWorld#removeEntityComplete(Entity,Boolean)}. <br>
* {@link ClientLevel#removeEntity(int, Entity.RemovalReason)}, {@link ServerLevel#removeEntityComplete(Entity, boolean)}. <br>
* <br>
* {@link #world} contains the world from which the entity is removed. <br>
* <br>
@@ -20,6 +20,7 @@
package net.minecraftforge.event.entity;
import net.minecraft.world.entity.Entity;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Event.HasResult;
/**
@@ -27,9 +28,11 @@ import net.minecraftforge.eventbus.api.Event.HasResult;
* This event is fired when ever the {@code mobGriefing} game rule is checked.<br>
* <br>
* This event has a {@link HasResult result}:
* <ul>
* <li>{@link Result#ALLOW} means this instance of mob griefing is allowed.</li>
* <li>{@link Result#DEFAULT} means the {@code mobGriefing} game rule is used to determine the behaviour.</li>
* <li>{@link Result#DENY} means this instance of mob griefing is not allowed.</li><br>
* <li>{@link Result#DENY} means this instance of mob griefing is not allowed.</li>
* </ul>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
*/
@HasResult
@@ -21,6 +21,7 @@ package net.minecraftforge.event.entity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
/**
@@ -21,11 +21,14 @@ package net.minecraftforge.event.entity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LightningBolt;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.eventbus.api.Cancelable;
/**
* EntityStruckByLightningEvent is fired when an Entity is about to be struck by lightening.<br>
* This event is fired whenever an EntityLightningBolt is updated to strike an Entity in
* {@link EntityLightningBolt#onUpdate()} via {@link ForgeEventFactory#onEntityStruckByLightning(Entity, EntityLightningBolt)}.<br>
* {@link LightningBolt#tick()} via {@link ForgeEventFactory#onEntityStruckByLightning(Entity, LightningBolt)}.<br>
* <br>
* {@link #lightning} contains the instance of EntityLightningBolt attempting to strike an entity.<br>
* <br>
@@ -24,11 +24,14 @@ import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.projectile.ThrownEnderpearl;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.fml.LogicalSide;
/**
* EntityTeleportEvent is fired when an event involving any teleportation of an Entity occurs.<br>
* If a method utilizes this {@link net.minecraftforge.eventbus.api.Event} as its parameter, the method will
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #getTarget()} contains the target destination.<br>
@@ -64,16 +67,16 @@ public class EntityTeleportEvent extends EntityEvent
/**
* EntityTeleportEvent.TeleportCommand is fired before a living entity is teleported
* from use of {@link net.minecraft.command.impl.TeleportCommand}.
* from use of {@link net.minecraft.server.commands.TeleportCommand}.
* <br>
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
* This event is {@link Cancelable}.<br>
* If the event is not canceled, the entity will be teleported.
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
* <br>
* This event is only fired on the {@link net.minecraftforge.fml.LogicalSide#SERVER} side.<br>
* This event is only fired on the {@link LogicalSide#SERVER} side.<br>
* <br>
* If this event is canceled, the entity will not be teleported.
*/
@@ -88,16 +91,16 @@ public class EntityTeleportEvent extends EntityEvent
/**
* EntityTeleportEvent.SpreadPlayersCommand is fired before a living entity is teleported
* from use of {@link net.minecraft.command.impl.SpreadPlayersCommand}.
* from use of {@link net.minecraft.server.commands.SpreadPlayersCommand}.
* <br>
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
* This event is {@link Cancelable}.<br>
* If the event is not canceled, the entity will be teleported.
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
* <br>
* This event is only fired on the {@link net.minecraftforge.fml.LogicalSide#SERVER} side.<br>
* This event is only fired on the {@link LogicalSide#SERVER} side.<br>
* <br>
* If this event is canceled, the entity will not be teleported.
*/
@@ -113,14 +116,14 @@ public class EntityTeleportEvent extends EntityEvent
/**
* EntityTeleportEvent.EnderEntity is fired before an Enderman or Shulker randomly teleports.
* <br>
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
* This event is {@link Cancelable}.<br>
* If the event is not canceled, the entity will be teleported.
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
* <br>
* This event is only fired on the {@link net.minecraftforge.fml.LogicalSide#SERVER} side.<br>
* This event is only fired on the {@link LogicalSide#SERVER} side.<br>
* <br>
* If this event is canceled, the entity will not be teleported.
*/
@@ -144,14 +147,14 @@ public class EntityTeleportEvent extends EntityEvent
/**
* EntityTeleportEvent.EnderPearl is fired before an Entity is teleported from an EnderPearlEntity.
* <br>
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
* This event is {@link Cancelable}.<br>
* If the event is not canceled, the entity will be teleported.
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
* <br>
* This event is only fired on the {@link net.minecraftforge.fml.LogicalSide#SERVER} side.<br>
* This event is only fired on the {@link LogicalSide#SERVER} side.<br>
* <br>
* If this event is canceled, the entity will not be teleported.
*/
@@ -194,14 +197,14 @@ public class EntityTeleportEvent extends EntityEvent
/**
* EntityTeleportEvent.ChorusFruit is fired before a LivingEntity is teleported due to consuming Chorus Fruit.
* <br>
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
* This event is {@link Cancelable}.<br>
* If the event is not canceled, the entity will be teleported.
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
* <br>
* This event is only fired on the {@link net.minecraftforge.fml.LogicalSide#SERVER} side.<br>
* This event is only fired on the {@link LogicalSide#SERVER} side.<br>
* <br>
* If this event is canceled, the entity will not be teleported.
*/
@@ -22,6 +22,7 @@ package net.minecraftforge.event.entity;
import net.minecraft.world.entity.Entity;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
/**
@@ -19,14 +19,20 @@
package net.minecraftforge.event.entity;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.world.entity.Entity;
import net.minecraft.sounds.SoundSource;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
/**
* PlaySoundAtEntityEvent is fired a sound is to be played at an Entity<br>
* This event is fired whenever a sound is set to be played at an Entity such as in
* {@link ClientPlayerEntity#playSound(SoundEvent, float, float)} and {@link World#playSound(PlayerEntity, double, double, double, SoundEvent, SoundCategory, float, float)}.<br>
* {@link LocalPlayer#playSound(SoundEvent, float, float)} and
* {@link Level#playSound(Player, double, double, double, SoundEvent, SoundSource, float, float)}.<br>
* <br>
* {@link #name} contains the name of the sound to be played at the Entity.<br>
* {@link #volume} contains the volume at which the sound is to be played originally.<br>
@@ -21,11 +21,13 @@ package net.minecraftforge.event.entity.living;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.eventbus.api.Cancelable;
/**
* This event is fired when an {@link EntityAnimal} is tamed. <br>
* It is fired via {@link ForgeEventFactory#onAnimalTame(EntityAnimal, EntityPlayer)}.
* This event is fired when an {@link Animal} is tamed. <br>
* It is fired via {@link ForgeEventFactory#onAnimalTame(Animal, Player)}.
* Forge fires this event for applicable vanilla animals, mods need to fire it themselves.
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}. If canceled, taming the animal will fail.
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
@@ -19,18 +19,22 @@
package net.minecraftforge.event.entity.living;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.AgeableMob;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.animal.Fox;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import javax.annotation.Nullable;
/**
* BabyEntitySpawnEvent is fired just before a baby entity is about to be spawned. <br>
* Parents will have disengaged their relationship. {@link @Cancelable} <br>
* It is possible to change the child completely by using {@link #setChild(EntityAgeable)} <br>
* This event is fired from {@link EntityAIMate#spawnBaby()} and {@link EntityAIVillagerMate#giveBirth()} <br>
* Parents will have disengaged their relationship. {@link Cancelable} <br>
* It is possible to change the child completely by using {@link #setChild(AgeableMob)} <br>
* This event is fired from {@link Animal#spawnChildFromBreeding(ServerLevel, Animal)} and
* {@link Fox#spawnChildFromBreeding(ServerLevel, Animal)} <br>
* <br>
* {@link #parentA} contains the initiating parent entity.<br>
* {@link #parentB} contains the secondary parent entity.<br>
@@ -19,6 +19,9 @@
package net.minecraftforge.event.entity.living;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.LivingEntity;
@@ -26,10 +29,10 @@ import net.minecraft.world.entity.LivingEntity;
/**
* LivingAttackEvent is fired when a living Entity is attacked. <br>
* This event is fired whenever an Entity is attacked in
* {@link EntityLivingBase#attackEntityFrom(DamageSource, float)} and
* {@link EntityPlayer#attackEntityFrom(DamageSource, float)}. <br>
* {@link LivingEntity#hurt(DamageSource, float)} and
* {@link Player#hurt(DamageSource, float)}. <br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingAttack(EntityLivingBase, DamageSource, float)}.<br>
* This event is fired via the {@link ForgeHooks#onLivingAttack(LivingEntity, DamageSource, float)}.<br>
* <br>
* {@link #source} contains the DamageSource of the attack. <br>
* {@link #amount} contains the amount of damage dealt to the entity. <br>
@@ -19,6 +19,7 @@
package net.minecraftforge.event.entity.living;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.LivingEntity;
@@ -28,15 +29,15 @@ import net.minecraft.world.entity.LivingEntity;
* At this point armor, potion and absorption modifiers have already been applied to damage - this is FINAL value.<br>
* Also note that appropriate resources (like armor durability and absorption extra hearths) have already been consumed.<br>
* This event is fired whenever an Entity is damaged in
* {@link EntityLivingBase#damageEntity(DamageSource, float)} and
* {@link EntityPlayer#damageEntity(DamageSource, float)}.<br>
* {@code LivingEntity#actuallyHurt(DamageSource, float)} and
* {@code Player#actuallyHurt(DamageSource, float)}.<br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingDamage(EntityLivingBase, DamageSource, float)}.<br>
* This event is fired via the {@link ForgeHooks#onLivingDamage(LivingEntity, DamageSource, float)}.<br>
* <br>
* {@link #source} contains the DamageSource that caused this Entity to be hurt. <br>
* {@link #amount} contains the final amount of damage that will be dealt to entity. <br>
* <br>
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the Entity is not hurt. Used resources WILL NOT be restored.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
@@ -19,6 +19,10 @@
package net.minecraftforge.event.entity.living;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.LivingEntity;
@@ -26,11 +30,11 @@ import net.minecraft.world.entity.LivingEntity;
/**
* LivingDeathEvent is fired when an Entity dies. <br>
* This event is fired whenever an Entity dies in
* {@link EntityLivingBase#onDeath(DamageSource)},
* {@link EntityPlayer#onDeath(DamageSource)}, and
* {@link EntityPlayerMP#onDeath(DamageSource)}. <br>
* {@link LivingEntity#die(DamageSource)},
* {@link Player#die(DamageSource)}, and
* {@link ServerPlayer#die(DamageSource)}. <br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingDeath(EntityLivingBase, DamageSource)}.<br>
* This event is fired via the {@link ForgeHooks#onLivingDeath(LivingEntity, DamageSource)}.<br>
* <br>
* {@link #source} contains the DamageSource that caused the entity to die. <br>
* <br>
@@ -19,15 +19,19 @@
package net.minecraftforge.event.entity.living;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.core.BlockPos;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
/**
* Fired when the ender dragon or wither attempts to destroy a block and when ever a zombie attempts to break a door. Basically a event version of {@link Block#canEntityDestroy(IBlockState, IBlockAccess, BlockPos, Entity)}<br>
* Fired when the ender dragon or wither attempts to destroy a block and when ever a zombie attempts to break a door. Basically a event version of {@link Block#canEntityDestroy(BlockState, BlockGetter, BlockPos, Entity)}<br>
* <br>
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the block will not be destroyed.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
@@ -24,13 +24,16 @@ import java.util.Collection;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
/**
* LivingDropsEvent is fired when an Entity's death causes dropped items to appear.<br>
* This event is fired whenever an Entity dies and drops items in
* {@link EntityLivingBase#onDeath(DamageSource)}.<br>
* {@link LivingEntity#die(DamageSource)}.<br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingDrops(EntityLivingBase, DamageSource, ArrayList, int, boolean)}.<br>
* This event is fired via the {@link ForgeHooks#onLivingDrops(LivingEntity, DamageSource, Collection, int, boolean)} .<br>
* <br>
* {@link #source} contains the DamageSource that caused the drop to occur.<br>
* {@link #drops} contains the ArrayList of EntityItems that will be dropped.<br>
@@ -61,7 +61,7 @@ public class LivingEntityUseItemEvent extends LivingEvent
* Drinking Potions/Milk
* Guarding with a sword
*
* Cancel the event, or set the duration or <= 0 to prevent it from processing.
* Cancel the event, or set the duration or {@literal <=} 0 to prevent it from processing.
*
*/
@Cancelable
@@ -76,7 +76,7 @@ public class LivingEntityUseItemEvent extends LivingEvent
/**
* Fired every tick that a player is 'using' an item, see {@link Start} for info.
*
* Cancel the event, or set the duration or <= 0 to cause the player to stop using the item.
* Cancel the event, or set the duration or {@literal <=} 0 to cause the player to stop using the item.
*
*/
@Cancelable
@@ -22,16 +22,18 @@ package net.minecraftforge.event.entity.living;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import javax.annotation.Nonnull;
/**
* {@link LivingEquipmentChangeEvent} is fired when the Equipment of a Entity changes. <br>
* This event is fired whenever changes in Equipment are detected in {@link EntityLivingBase#onUpdate()}. <br>
* This event is fired whenever changes in Equipment are detected in {@link LivingEntity#tick()}. <br>
* This also includes entities joining the World, as well as being cloned. <br>
* This event is fired on server-side only. <br>
* <br>
* {@link #slot} contains the affected {@link EntityEquipmentSlot}. <br>
* {@link #slot} contains the affected {@link EquipmentSlot}. <br>
* {@link #from} contains the {@link ItemStack} that was equipped previously. <br>
* {@link #to} contains the {@link ItemStack} that is equipped now. <br>
* <br>
@@ -20,15 +20,18 @@
package net.minecraftforge.event.entity.living;
import net.minecraft.world.entity.Entity;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraft.world.entity.LivingEntity;
import net.minecraftforge.event.entity.EntityEvent;
import net.minecraftforge.eventbus.api.Event;
import javax.annotation.Nullable;
/**
* LivingEvent is fired whenever an event involving Living entities occurs.<br>
* If a method utilizes this {@link net.minecraftforge.eventbus.api.Event} as its parameter, the method will
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.<br>
@@ -50,9 +53,9 @@ public class LivingEvent extends EntityEvent
/**
* LivingUpdateEvent is fired when an Entity is updated. <br>
* This event is fired whenever an Entity is updated in
* {@link EntityLivingBase#onUpdate()}. <br>
* {@link LivingEntity#tick()}. <br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingUpdate(EntityLivingBase)}.<br>
* This event is fired via the {@link ForgeHooks#onLivingUpdate(LivingEntity)}.<br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the Entity does not update.<br>
@@ -70,10 +73,10 @@ public class LivingEvent extends EntityEvent
/**
* LivingJumpEvent is fired when an Entity jumps.<br>
* This event is fired whenever an Entity jumps in
* {@link EntityLivingBase#jump()}, {@link EntityMagmaCube#jump()},
* and {@link EntityHorse#jump()}.<br>
* {@code LivingEntity#jumpFromGround()}, {@code MagmaCube#jumpFromGround()},
* and {@code Horse#jumpFromGround()}.<br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingJump(EntityLivingBase)}.<br>
* This event is fired via the {@link ForgeHooks#onLivingJump(LivingEntity)}.<br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
@@ -19,15 +19,18 @@
package net.minecraftforge.event.entity.living;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraft.world.entity.LivingEntity;
/**
* LivingFallEvent is fired when an Entity is set to be falling.<br>
* This event is fired whenever an Entity is set to fall in
* {@link EntityLivingBase#fall(float, float)}.<br>
* {@link LivingEntity#causeFallDamage(float, float, DamageSource)}.<br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingFall(EntityLivingBase, float, float)}.<br>
* This event is fired via the {@link ForgeHooks#onLivingFall(LivingEntity, float, float)}.<br>
* <br>
* {@link #distance} contains the distance the Entity is to fall. If this event is canceled, this value is set to 0.0F.
* <br>
@@ -19,14 +19,16 @@
package net.minecraftforge.event.entity.living;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraft.world.entity.LivingEntity;
/**
* LivingHealEvent is fired when an Entity is set to be healed. <br>
* This event is fired whenever an Entity is healed in {@link EntityLivingBase#heal(float)}<br>
* This event is fired whenever an Entity is healed in {@link LivingEntity#heal(float)}<br>
* <br>
* This event is fired via the {@link ForgeEventFactory#onLivingHeal(EntityLivingBase, float)}.<br>
* This event is fired via the {@link ForgeEventFactory#onLivingHeal(LivingEntity, float)}.<br>
* <br>
* {@link #amount} contains the amount of healing done to the Entity that was healed. <br>
* <br>
@@ -21,14 +21,17 @@ package net.minecraftforge.event.entity.living;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.LivingEntity;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
/**
* LivingHurtEvent is fired when an Entity is set to be hurt. <br>
* This event is fired whenever an Entity is hurt in
* {@link EntityLivingBase#damageEntity(DamageSource, float)} and
* {@link EntityPlayer#damageEntity(DamageSource, float)}.<br>
* {@code LivingEntity#actuallyHurt(DamageSource, float)} and
* {@code Player#actuallyHurt(DamageSource, float)}.<br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingHurt(EntityLivingBase, DamageSource, float)}.<br>
* This event is fired via the {@link ForgeHooks#onLivingHurt(LivingEntity, DamageSource, float)}.<br>
* <br>
* {@link #source} contains the DamageSource that caused this Entity to be hurt. <br>
* {@link #amount} contains the amount of damage dealt to the Entity that was hurt. <br>
@@ -19,25 +19,30 @@
package net.minecraftforge.event.entity.living;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
/**
* LivingKnockBackEvent is fired when a living entity is about to be knocked back. <br>
* This event is fired whenever an Entity is knocked back in
* {@link EntityLivingBase#attackEntityFrom(DamageSource, float)},
* {@link EntityLivingBase#blockWithShield(EntityLivingBase)},
* {@link EntityMob#attackEntityAsMob(Entity)} and
* {@link EntityPlayer#attackTargetEntityWithCurrentItem(Entity)} <br>
* {@link LivingEntity#hurt(DamageSource, float)},
* {@code LivingEntity#blockUsingShield(LivingEntity)},
* {@link Mob#doHurtTarget(Entity)} and
* {@link Player#attack(Entity)} <br>
* <br>
* This event is fired via {@link ForgeHooks#onLivingKnockBack(EntityLivingBase, Entity, float, double, double)}.<br>
* This event is fired via {@link ForgeHooks#onLivingKnockBack(LivingEntity, float, double, double)} .<br>
* <br>
* {@link #attacker} contains the Entity that caused the knock back. <br>
* {@link #strength} contains the strength of the knock back. <br>
* {@link #ratioX} contains the x ratio of the knock back. <br>
* {@link #ratioZ} contains the z ratio of the knock back. <br>
* <br>
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the entity is not knocked back.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
@@ -20,14 +20,16 @@
package net.minecraftforge.event.entity.living;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
/**
* LivingSetAttackTargetEvent is fired when an Entity sets a target to attack.<br>
* This event is fired whenever an Entity sets a target to attack in
* {@link EntityLiving#setAttackTarget(EntityLivingBase)} and
* {@link EntityLivingBase#setRevengeTarget(EntityLivingBase)}.<br>
* {@link Mob#setTarget(LivingEntity)}.<br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingSetAttackTarget(EntityLivingBase, EntityLivingBase)}.<br>
* This event is fired via the {@link ForgeHooks#onLivingSetAttackTarget(LivingEntity, LivingEntity)}.<br>
* <br>
* {@link #target} contains the newly targeted Entity.<br>
* <br>
@@ -20,17 +20,21 @@
package net.minecraftforge.event.entity.living;
import javax.annotation.Nullable;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.level.BaseSpawner;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.eventbus.api.Event.HasResult;
/**
* LivingSpawnEvent is fired for any events associated with Living Entities spawn status. <br>
* If a method utilizes this {@link Event} as its parameter, the method will
* If a method utilizes this event as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #world} contains the world in which this living Entity is being spawned.<br>
@@ -114,7 +118,7 @@ public class LivingSpawnEvent extends LivingEvent
* SpecialSpawn is fired when an Entity is to be spawned.<br>
* This allows you to do special inializers in the new entity.<br>
* <br>
* This event is fired via the {@link ForgeEventFactory#doSpecialSpawn(EntityLiving, World, float, float, float)}.<br>
* This event is fired via the {@link ForgeEventFactory#doSpecialSpawn(Mob, Level, float, float, float, BaseSpawner, MobSpawnType)}.<br>
* <br>
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
* If this event is canceled, the Entity is not spawned.<br>
@@ -160,7 +164,7 @@ public class LivingSpawnEvent extends LivingEvent
* This is fired every tick for every despawnable entity. Be efficient in your handlers.
*
* Note: this is not fired <em>if</em> the mob is definitely going to otherwise despawn. It is fired to check if
* the mob can be allowed to despawn. See {@link EntityLiving#despawnEntity}
* the mob can be allowed to despawn. See {@link LivingEntity#checkDespawn()}
*
* @author cpw
*
@@ -23,6 +23,8 @@ import java.util.Collection;
import java.util.Collections;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
/**
* Fires after Potion Color Calculation.
@@ -19,19 +19,18 @@
package net.minecraftforge.event.entity.living;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event.HasResult;
/**
* This Event and its subevents gets fired from {@link EntityLivingBase} on the {@link MinecraftForge#EVENT_BUS}.<br>
* This Event and its subevents gets fired from {@link LivingEntity} on the {@link MinecraftForge#EVENT_BUS}.<br>
*/
public class PotionEvent extends LivingEvent
{
@@ -83,7 +82,7 @@ public class PotionEvent extends LivingEvent
}
/**
* @return the PotionEffect. In the remove event this can be null if the Entity does not have a {@link Potion} of the right type active.
* @return the PotionEffect. In the remove event this can be null if the Entity does not have a {@link MobEffect} of the right type active.
*/
@Override
@Nullable
@@ -22,13 +22,13 @@ package net.minecraftforge.event.entity.living;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.monster.Zombie;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.event.entity.EntityEvent;
import net.minecraftforge.eventbus.api.Event.HasResult;
/**
* ZombieEvent is fired whenever a zombie is spawned for aid.
* If a method utilizes this {@link Event} as its parameter, the method will
* If a method utilizes this event as its parameter, the method will
* receive every child event of this class.
*
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
@@ -48,9 +48,9 @@ public class ZombieEvent extends EntityEvent {
/**
* SummonAidEvent is fired when a Zombie Entity is summoned.
* This event is fired whenever a Zombie Entity is summoned in
* {@link EntityZombie#attackEntityFrom(DamageSource, float)}.
* {@code Zombie#actuallyHurt(DamageSource, float)}.
*
* This event is fired via the {@link ForgeEventFactory#fireZombieSummonAid(EntityZombie, World, int, int, int, EntityLivingBase, double)}.
* This event is fired via the {@link ForgeEventFactory#fireZombieSummonAid(Zombie, Level, int, int, int, LivingEntity, double)}.
*
* {@link #customSummonedAid} remains null, but can be populated with a custom EntityZombie which will be spawned.
* {@link #world} contains the world that this summoning is occurring in.
@@ -21,6 +21,7 @@ package net.minecraftforge.event.entity.player;
import net.minecraft.advancements.Advancement;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.common.MinecraftForge;
/**
* This event is fired when a player gets an advancement.
@@ -19,6 +19,9 @@
package net.minecraftforge.event.entity.player;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.BowItem;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
@@ -29,12 +32,12 @@ import javax.annotation.Nonnull;
/**
* ArrowLooseEvent is fired when a player stops using a bow.<br>
* This event is fired whenever a player stops using a bow in
* {@link ItemBow#onPlayerStoppedUsing(ItemStack, World, EntityLivingBase, int)}.<br>
* {@link BowItem#releaseUsing(ItemStack, Level, LivingEntity, int)}.<br>
* <br>
* {@link #bow} contains the ItemBow ItemStack that was used in this event.<br>
* {@link #charge} contains the value for how much the player had charged before stopping the shot.<br>
* <br>
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the player does not stop using the bow.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
@@ -20,17 +20,19 @@
package net.minecraftforge.event.entity.player;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.BowItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.MinecraftForge;
import javax.annotation.Nonnull;
/**
* ArrowNockEvent is fired when a player begins using a bow.<br>
* This event is fired whenever a player begins using a bow in
* {@link ItemBow#onItemRightClick(World, EntityPlayer, EnumHand)}.<br>
* {@link BowItem#use(Level, Player, InteractionHand)}.<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
Loaded 100 of 163 files, more files were not shown because too many files have changed in this diff. Show more