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

@@ -7,8 +7,7 @@ package net.minecraftforge.items.wrapper;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.items.IItemHandlerModifiable;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;
// combines multiple IItemHandlerModifiable into one interface
public class CombinedInvWrapper implements IItemHandlerModifiable
@@ -66,7 +65,7 @@ public class CombinedInvWrapper implements IItemHandlerModifiable
}
@Override
public void setStackInSlot(int slot, @Nonnull ItemStack stack)
public void setStackInSlot(int slot, @NotNull ItemStack stack)
{
int index = getIndexForSlot(slot);
IItemHandlerModifiable handler = getHandlerFromIndex(index);
@@ -81,7 +80,7 @@ public class CombinedInvWrapper implements IItemHandlerModifiable
}
@Override
@Nonnull
@NotNull
public ItemStack getStackInSlot(int slot)
{
int index = getIndexForSlot(slot);
@@ -91,8 +90,8 @@ public class CombinedInvWrapper implements IItemHandlerModifiable
}
@Override
@Nonnull
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
@NotNull
public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate)
{
int index = getIndexForSlot(slot);
IItemHandlerModifiable handler = getHandlerFromIndex(index);
@@ -101,7 +100,7 @@ public class CombinedInvWrapper implements IItemHandlerModifiable
}
@Override
@Nonnull
@NotNull
public ItemStack extractItem(int slot, int amount, boolean simulate)
{
int index = getIndexForSlot(slot);
@@ -120,7 +119,7 @@ public class CombinedInvWrapper implements IItemHandlerModifiable
}
@Override
public boolean isItemValid(int slot, @Nonnull ItemStack stack)
public boolean isItemValid(int slot, @NotNull ItemStack stack)
{
int index = getIndexForSlot(slot);
IItemHandlerModifiable handler = getHandlerFromIndex(index);
@@ -8,8 +8,7 @@ package net.minecraftforge.items.wrapper;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.IItemHandlerModifiable;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;
public class EmptyHandler implements IItemHandlerModifiable
{
@@ -22,28 +21,28 @@ public class EmptyHandler implements IItemHandlerModifiable
}
@Override
@Nonnull
@NotNull
public ItemStack getStackInSlot(int slot)
{
return ItemStack.EMPTY;
}
@Override
@Nonnull
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
@NotNull
public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate)
{
return stack;
}
@Override
@Nonnull
@NotNull
public ItemStack extractItem(int slot, int amount, boolean simulate)
{
return ItemStack.EMPTY;
}
@Override
public void setStackInSlot(int slot, @Nonnull ItemStack stack)
public void setStackInSlot(int slot, @NotNull ItemStack stack)
{
// nothing to do here
}
@@ -55,7 +54,7 @@ public class EmptyHandler implements IItemHandlerModifiable
}
@Override
public boolean isItemValid(int slot, @Nonnull ItemStack stack)
public boolean isItemValid(int slot, @NotNull ItemStack stack)
{
return false;
}
@@ -13,10 +13,9 @@ import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.IItemHandlerModifiable;
import net.minecraftforge.items.ItemHandlerHelper;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
/**
* Exposes the armor or hands inventory of an {@link LivingEntity} as an {@link IItemHandler} using {@link LivingEntity#getItemBySlot(EquipmentSlot)} and
@@ -61,16 +60,16 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
return slots.size();
}
@Nonnull
@NotNull
@Override
public ItemStack getStackInSlot(final int slot)
{
return entity.getItemBySlot(validateSlotIndex(slot));
}
@Nonnull
@NotNull
@Override
public ItemStack insertItem(final int slot, @Nonnull final ItemStack stack, final boolean simulate)
public ItemStack insertItem(final int slot, @NotNull final ItemStack stack, final boolean simulate)
{
if (stack.isEmpty())
return ItemStack.EMPTY;
@@ -109,7 +108,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
return reachedLimit ? ItemHandlerHelper.copyStackWithSize(stack, stack.getCount() - limit) : ItemStack.EMPTY;
}
@Nonnull
@NotNull
@Override
public ItemStack extractItem(final int slot, final int amount, final boolean simulate)
{
@@ -152,13 +151,13 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
return equipmentSlot.getType() == EquipmentSlot.Type.ARMOR ? 1 : 64;
}
protected int getStackLimit(final int slot, @Nonnull final ItemStack stack)
protected int getStackLimit(final int slot, @NotNull final ItemStack stack)
{
return Math.min(getSlotLimit(slot), stack.getMaxStackSize());
}
@Override
public void setStackInSlot(final int slot, @Nonnull final ItemStack stack)
public void setStackInSlot(final int slot, @NotNull final ItemStack stack)
{
final EquipmentSlot equipmentSlot = validateSlotIndex(slot);
if (ItemStack.matches(entity.getItemBySlot(equipmentSlot), stack))
@@ -167,7 +166,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
}
@Override
public boolean isItemValid(int slot, @Nonnull ItemStack stack)
public boolean isItemValid(int slot, @NotNull ItemStack stack)
{
return true;
}
@@ -9,8 +9,7 @@ import net.minecraft.world.Container;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.items.IItemHandlerModifiable;
import net.minecraftforge.items.ItemHandlerHelper;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;
public class InvWrapper implements IItemHandlerModifiable
{
@@ -48,15 +47,15 @@ public class InvWrapper implements IItemHandlerModifiable
}
@Override
@Nonnull
@NotNull
public ItemStack getStackInSlot(int slot)
{
return getInv().getItem(slot);
}
@Override
@Nonnull
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
@NotNull
public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate)
{
if (stack.isEmpty())
return ItemStack.EMPTY;
@@ -144,7 +143,7 @@ public class InvWrapper implements IItemHandlerModifiable
}
@Override
@Nonnull
@NotNull
public ItemStack extractItem(int slot, int amount, boolean simulate)
{
if (amount == 0)
@@ -179,7 +178,7 @@ public class InvWrapper implements IItemHandlerModifiable
}
@Override
public void setStackInSlot(int slot, @Nonnull ItemStack stack)
public void setStackInSlot(int slot, @NotNull ItemStack stack)
{
getInv().setItem(slot, stack);
}
@@ -191,7 +190,7 @@ public class InvWrapper implements IItemHandlerModifiable
}
@Override
public boolean isItemValid(int slot, @Nonnull ItemStack stack)
public boolean isItemValid(int slot, @NotNull ItemStack stack)
{
return getInv().canPlaceItem(slot, stack);
}
@@ -8,8 +8,7 @@ package net.minecraftforge.items.wrapper;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ItemStack;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;
public class PlayerArmorInvWrapper extends RangedWrapper
{
@@ -22,8 +21,8 @@ public class PlayerArmorInvWrapper extends RangedWrapper
}
@Override
@Nonnull
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
@NotNull
public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate)
{
EquipmentSlot equ = null;
for (EquipmentSlot s : EquipmentSlot.values())
@@ -8,8 +8,7 @@ package net.minecraftforge.items.wrapper;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.item.ItemStack;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;
/**
* Exposes the player inventory WITHOUT the armor inventory as IItemHandler.
@@ -26,8 +25,8 @@ public class PlayerMainInvWrapper extends RangedWrapper
}
@Override
@Nonnull
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
@NotNull
public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate)
{
ItemStack rest = super.insertItem(slot, stack, simulate);
if (rest.getCount()!= stack.getCount())
@@ -8,8 +8,7 @@ package net.minecraftforge.items.wrapper;
import com.google.common.base.Preconditions;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.items.IItemHandlerModifiable;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;
/**
* A wrapper that composes another IItemHandlerModifiable, exposing only a range of the composed slots.
@@ -36,7 +35,7 @@ public class RangedWrapper implements IItemHandlerModifiable {
}
@Override
@Nonnull
@NotNull
public ItemStack getStackInSlot(int slot)
{
if (checkSlot(slot))
@@ -48,8 +47,8 @@ public class RangedWrapper implements IItemHandlerModifiable {
}
@Override
@Nonnull
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
@NotNull
public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate)
{
if (checkSlot(slot))
{
@@ -60,7 +59,7 @@ public class RangedWrapper implements IItemHandlerModifiable {
}
@Override
@Nonnull
@NotNull
public ItemStack extractItem(int slot, int amount, boolean simulate)
{
if (checkSlot(slot))
@@ -72,7 +71,7 @@ public class RangedWrapper implements IItemHandlerModifiable {
}
@Override
public void setStackInSlot(int slot, @Nonnull ItemStack stack)
public void setStackInSlot(int slot, @NotNull ItemStack stack)
{
if (checkSlot(slot))
{
@@ -92,7 +91,7 @@ public class RangedWrapper implements IItemHandlerModifiable {
}
@Override
public boolean isItemValid(int slot, @Nonnull ItemStack stack)
public boolean isItemValid(int slot, @NotNull ItemStack stack)
{
if (checkSlot(slot))
{
@@ -11,9 +11,8 @@ import net.minecraft.core.Direction;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.IItemHandlerModifiable;
import net.minecraftforge.items.ItemHandlerHelper;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class SidedInvWrapper implements IItemHandlerModifiable
{
@@ -73,7 +72,7 @@ public class SidedInvWrapper implements IItemHandlerModifiable
}
@Override
@Nonnull
@NotNull
public ItemStack getStackInSlot(int slot)
{
int i = getSlot(inv, slot, side);
@@ -81,8 +80,8 @@ public class SidedInvWrapper implements IItemHandlerModifiable
}
@Override
@Nonnull
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
@NotNull
public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate)
{
if (stack.isEmpty())
return ItemStack.EMPTY;
@@ -169,7 +168,7 @@ public class SidedInvWrapper implements IItemHandlerModifiable
}
@Override
public void setStackInSlot(int slot, @Nonnull ItemStack stack)
public void setStackInSlot(int slot, @NotNull ItemStack stack)
{
int slot1 = getSlot(inv, slot, side);
@@ -183,7 +182,7 @@ public class SidedInvWrapper implements IItemHandlerModifiable
}
@Override
@Nonnull
@NotNull
public ItemStack extractItem(int slot, int amount, boolean simulate)
{
if (amount == 0)
@@ -231,7 +230,7 @@ public class SidedInvWrapper implements IItemHandlerModifiable
}
@Override
public boolean isItemValid(int slot, @Nonnull ItemStack stack)
public boolean isItemValid(int slot, @NotNull ItemStack stack)
{
int slot1 = getSlot(inv, slot, side);
return slot1 == -1 ? false : inv.canPlaceItem(slot1, stack);