mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 12:20:11 +00:00
[1.17.x Omnibus] Fix typos and javadocs across code base (#8144)
This commit is contained in:
1 parent
df8954869a
commit
b4feee8046
163 files changed
+708
-454
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user