Forge 1.19

* Bump pack.mcmeta formats
* 1.19 biome modifiers
* Mark ClientPlayerNetworkEvent.LoggedOutEvent's getters as nullable
* Add docs and package-info to client extension interfaces package
* Move RenderBlockOverlayEvent hooks to ForgeHooksClient
* Add package-infos to client events package
* Rename SoundLoadEvent to SoundEngineLoadEvent

This reduces confusion from consumers which may think the
name SoundLoadEvent refers to an individual sound being loaded rather
than the sound engine.
* Document and change SoundLoadEvent to fire on mod bus

Previously, it fired on both the mod bus and the Forge bus, which is
confusing for consumers.
* Delete SoundSetupEvent

Looking at its original implementation shows that there isn't an
appropriate place in the new sound code to reinsert the event, and the
place of 'sound engine/manager initialization event' is taken already by SoundLoadEvent.
* Perform some cleanup on client events

 - Removed nullable annotations from ClientPlayerNetworkEvent
 - Renamed #getPartialTicks methods to #getPartialTick, to be consistent
  with vanilla's naming of the partial tick
 - Cleanup documentation to remove line breaks, use the
  spelling 'cancelled' over
  'canceled', and improve docs on existing and
   new methods.
* Remove EntityEvent.CanUpdate

Closes MinecraftForge/MinecraftForge#6394
* Switch to Jetbrains nullability annotations
* New PlayLevelSoundEvent; replaces old PlaySoundAtEntityEvent
* Remove ForgeWorldPresetScreens
* Remove IForgeRegistryEntry
* Remove use of List<Throwable> in FML's CompletableFutures
* Add docs to mod loading stages, stages, and phases
* Gradle 7.4.2
* Use SLF4J in FMLLoader and other subprojects
* Switch dynamic versions in subprojects to pinned ones
* Switch ForgeRoot and MDK to FG plugin markers
* Configure Forge javadoc task

The task now uses a custom stylesheet with MCForge elements, and
configured to combine the generation from the four FML subprojects
(fmlloader, fmlcore, javafmllanguage, mclanguage) and the Forge project
into the javadoc output.
* Update docs/md files, for 1.19 update and the move away from IRC to Discord.
* Make "Potentially dangerous alternative prefix" a debug warning, not info.

Co-authored-by: Curle <[email protected]>
Co-authored-by: sciwhiz12 <[email protected]>
Signed-off-by: SizableShrimp <[email protected]>
This commit is contained in:
committed 2022-06-07 15:31:26 -05:00
1 parent 270e778ac5
commit 4ed9117799
1485 files changed
+14960 -15446

No files matched your search

@@ -18,8 +18,7 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.Level;
import net.minecraftforge.server.ServerLifecycleHooks;
import javax.annotation.Nullable;
import org.jetbrains.annotations.Nullable;
/**
* Represents a captured snapshot of a block which will not change
@@ -67,25 +67,23 @@ import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.server.ServerLifecycleHooks;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Set;
import java.util.UUID;
//Preliminary, simple Fake Player class
public class FakePlayer extends ServerPlayer
{
public FakePlayer(ServerLevel level, GameProfile name)
{
super(level.getServer(), level, name);
super(level.getServer(), level, name, null);
this.connection = new FakePlayerNetHandler(level.getServer(), this);
}
@Override public Vec3 position(){ return new Vec3(0, 0, 0); }
@Override public BlockPos blockPosition(){ return BlockPos.ZERO; }
@Override public void displayClientMessage(Component chatComponent, boolean actionBar){}
@Override public void sendMessage(Component component, UUID senderUUID) {}
@Override public void awardStat(Stat par1StatBase, int par2){}
//@Override public void openGui(Object mod, int modGuiId, World world, int x, int y, int z){}
@Override public boolean isInvulnerableTo(DamageSource source){ return true; }
@@ -10,8 +10,8 @@ import net.minecraft.world.level.block.SoundType;
import net.minecraft.sounds.SoundEvent;
import net.minecraftforge.registries.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.function.Supplier;
/**
@@ -51,35 +51,35 @@ public class ForgeSoundType extends SoundType
this.fallSound = fallSoundIn;
}
@Nonnull
@NotNull
@Override
public SoundEvent getBreakSound()
{
return breakSound.get();
}
@Nonnull
@NotNull
@Override
public SoundEvent getStepSound()
{
return stepSound.get();
}
@Nonnull
@NotNull
@Override
public SoundEvent getPlaceSound()
{
return placeSound.get();
}
@Nonnull
@NotNull
@Override
public SoundEvent getHitSound()
{
return hitSound.get();
}
@Nonnull
@NotNull
@Override
public SoundEvent getFallSound()
{
@@ -7,8 +7,6 @@ package net.minecraftforge.common.util;
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;
@@ -16,6 +14,7 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.level.portal.PortalForcer;
import net.minecraft.server.level.ServerLevel;
import org.jetbrains.annotations.Nullable;
/**
* Interface for handling the placement of entities during dimension change.
@@ -52,16 +51,16 @@ public interface ITeleporter
}
/**
* Gets the PortalInfo. defaultPortalInfo references the
* vanilla code and should not be used for your purposes.
* Override this method to handle your own logic.
* Gets the PortalInfo. defaultPortalInfo references the
* vanilla code and should not be used for your purposes.
* Override this method to handle your own logic.
* <p>
* Return {@code null} to prevent teleporting.
*
*
* @param entity The entity teleporting before the teleport
* @param destWorld The world the entity is teleporting to
* @param defaultPortalInfo A reference to the vanilla method for getting portal info. You should implement your own logic instead of using this
*
*
* @return The location, rotation, and motion of the entity in the destWorld after the teleport
*/
@Nullable
@@ -69,7 +68,7 @@ public interface ITeleporter
{
return this.isVanilla() ? defaultPortalInfo.apply(destWorld) : new PortalInfo(entity.position(), Vec3.ZERO, entity.getYRot(), entity.getXRot());
}
/**
* Is this teleporter the vanilla instance.
*/
@@ -26,8 +26,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.nbt.TagParser;
import net.minecraft.nbt.CompoundTag;
import javax.annotation.Nullable;
import org.jetbrains.annotations.Nullable;
public class JsonUtils
{
@@ -5,8 +5,8 @@
package net.minecraftforge.common.util;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.function.Supplier;
/**
@@ -19,7 +19,7 @@ public interface Lazy<T> extends Supplier<T>
* Constructs a lazy-initialized object
* @param supplier The supplier for the value, to be called the first time the value is needed.
*/
static <T> Lazy<T> of(@Nonnull Supplier<T> supplier)
static <T> Lazy<T> of(@NotNull Supplier<T> supplier)
{
return new Lazy.Fast<>(supplier);
}
@@ -28,7 +28,7 @@ public interface Lazy<T> extends Supplier<T>
* Constructs a thread-safe lazy-initialized object
* @param supplier The supplier for the value, to be called the first time the value is needed.
*/
static <T> Lazy<T> concurrentOf(@Nonnull Supplier<T> supplier)
static <T> Lazy<T> concurrentOf(@NotNull Supplier<T> supplier)
{
return new Lazy.Concurrent<>(supplier);
}
@@ -10,8 +10,6 @@ import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import net.minecraft.MethodsReturnNonnullByDefault;
@@ -21,6 +19,8 @@ import org.apache.commons.lang3.mutable.MutableObject;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* This object encapsulates a lazy value, with typical transformation operations
@@ -35,7 +35,7 @@ import org.apache.logging.log4j.Logger;
* must never be null.
* <p>
* The empty instance can be retrieved with {@link #empty()}.
*
*
* @param <T> The type of the optional value.
*/
@ParametersAreNonnullByDefault
@@ -51,13 +51,13 @@ public class LazyOptional<T>
private Set<NonNullConsumer<LazyOptional<T>>> listeners = new HashSet<>();
private boolean isValid = true;
private static final @Nonnull LazyOptional<Void> EMPTY = new LazyOptional<>(null);
private static final @NotNull LazyOptional<Void> EMPTY = new LazyOptional<>(null);
private static final Logger LOGGER = LogManager.getLogger();
/**
* Construct a new {@link LazyOptional} that wraps the given
* {@link NonNullSupplier}.
*
*
* @param instanceSupplier The {@link NonNullSupplier} to wrap. Cannot return
* null, but can be null itself. If null, this method
* returns {@link #empty()}.
@@ -79,7 +79,7 @@ public class LazyOptional<T>
* This method hides an unchecked cast to the inferred type. Only use this if
* you are sure the type should match. For capabilities, generally
* {@link Capability#orEmpty(Capability, LazyOptional)} should be used.
*
*
* @return This {@link LazyOptional}, cast to the inferred generic type
*/
@SuppressWarnings("unchecked")
@@ -126,7 +126,7 @@ public class LazyOptional<T>
/**
* Check if this {@link LazyOptional} is non-empty.
*
*
* @return {@code true} if this {@link LazyOptional} is non-empty, i.e. holds a
* non-null supplier
*/
@@ -202,7 +202,7 @@ public class LazyOptional<T>
* <em>It is important to note that this method is <strong>not</strong> lazy, as
* it must resolve the value of the supplier to validate it with the
* predicate.</em>
*
*
* @param predicate A {@link NonNullPredicate} to apply to the result of the
* contained supplier, if non-empty
* @return An {@link Optional} containing the result of the contained
@@ -5,16 +5,16 @@
package net.minecraftforge.common.util;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;
import java.util.function.Consumer;
/**
* Equivalent to {@link Consumer}, except with nonnull contract.
*
*
* @see Consumer
*/
@FunctionalInterface
public interface NonNullConsumer<T>
{
void accept(@Nonnull T t);
void accept(@NotNull T t);
}
@@ -5,17 +5,17 @@
package net.minecraftforge.common.util;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;
import java.util.function.Function;
/**
* Equivalent to {@link Function}, except with nonnull contract.
*
*
* @see Function
*/
@FunctionalInterface
public interface NonNullFunction<T, R>
{
@Nonnull
R apply(@Nonnull T t);
@NotNull
R apply(@NotNull T t);
}
@@ -5,7 +5,7 @@
package net.minecraftforge.common.util;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;
import java.util.Objects;
/**
@@ -19,7 +19,7 @@ public interface NonNullLazy<T> extends NonNullSupplier<T>
* Constructs a lazy-initialized object
* @param supplier The supplier for the value, to be called the first time the value is needed.
*/
static <T> NonNullLazy<T> of(@Nonnull NonNullSupplier<T> supplier)
static <T> NonNullLazy<T> of(@NotNull NonNullSupplier<T> supplier)
{
Lazy<T> lazy = Lazy.of(supplier::get);
return () -> Objects.requireNonNull(lazy.get());
@@ -29,7 +29,7 @@ public interface NonNullLazy<T> extends NonNullSupplier<T>
* Constructs a thread-safe lazy-initialized object
* @param supplier The supplier for the value, to be called the first time the value is needed.
*/
static <T> NonNullLazy<T> concurrentOf(@Nonnull NonNullSupplier<T> supplier)
static <T> NonNullLazy<T> concurrentOf(@NotNull NonNullSupplier<T> supplier)
{
Lazy<T> lazy = Lazy.concurrentOf(supplier::get);
return () -> Objects.requireNonNull(lazy.get());
@@ -5,16 +5,16 @@
package net.minecraftforge.common.util;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;
import java.util.function.Predicate;
/**
* Equivalent to {@link Predicate}, except with nonnull contract.
*
*
* @see Predicate
*/
@FunctionalInterface
public interface NonNullPredicate<T>
{
boolean test(@Nonnull T t);
boolean test(@NotNull T t);
}
@@ -5,16 +5,16 @@
package net.minecraftforge.common.util;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;
import java.util.function.Supplier;
/**
* Equivalent to {@link Supplier}, except with nonnull contract.
*
*
* @see Supplier
*/
@FunctionalInterface
public interface NonNullSupplier<T>
{
@Nonnull T get();
@NotNull T get();
}
@@ -7,8 +7,8 @@ package net.minecraftforge.common.util;
import com.google.common.collect.Streams;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -93,7 +93,7 @@ public class TextTable
}
}
public void add(@Nonnull Object... values)
public void add(@NotNull Object... values)
{
if (values.length != columns.size())
{
@@ -5,11 +5,9 @@
package net.minecraftforge.common.util;
import javax.annotation.Nullable;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.saveddata.SavedData;
import net.minecraftforge.common.capabilities.CapabilityProvider;
import org.jetbrains.annotations.Nullable;
public class WorldCapabilityData extends SavedData
{