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

@@ -12,9 +12,12 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.entity.ai.attributes.AttributeInstance;
import net.minecraft.world.level.biome.Biome;
import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegisterEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -31,10 +34,8 @@ import net.minecraft.world.item.Item;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.biome.Biome.BiomeCategory;
import net.minecraft.server.level.ServerLevel;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
@@ -94,7 +95,8 @@ public class GravityAttributeTest
for(LivingEntity liv : list)
{
AttributeInstance grav = liv.getAttribute(ForgeMod.ENTITY_GRAVITY.get());
boolean inPlains = Biome.getBiomeCategory(liv.level.getBiome(liv.blockPosition())) == BiomeCategory.PLAINS;
boolean inPlains = liv.level.getBiome(liv.blockPosition()).is(BiomeTags.IS_FOREST);
if (inPlains && !grav.hasModifier(REDUCED_GRAVITY))
{
logger.info("Granted low gravity to Entity: {}", liv);
@@ -112,9 +114,10 @@ public class GravityAttributeTest
}
@SubscribeEvent
public void registerItems(RegistryEvent.Register<Item> event)
public void registerItems(RegisterEvent event)
{
event.getRegistry().register(new ItemGravityStick(new Properties().tab(CreativeModeTab.TAB_TOOLS).rarity(Rarity.RARE)).setRegistryName("gravity_attribute_test:gravity_stick"));
event.register(ForgeRegistries.Keys.ITEMS, helper -> helper.register("gravity_stick",
new ItemGravityStick(new Properties().tab(CreativeModeTab.TAB_TOOLS).rarity(Rarity.RARE))));
}
public static class ItemGravityStick extends Item
@@ -8,7 +8,7 @@ package net.minecraftforge.debug.entity;
import net.minecraft.client.renderer.entity.PigRenderer;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientboundAddMobPacket;
import net.minecraft.network.protocol.game.ClientboundAddEntityPacket;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityDimensions;
@@ -64,8 +64,8 @@ public class PartEntityTest
event.registerEntityRenderer(TEST_ENTITY.get(), PigRenderer::new);
}
}
private static class TestEntity extends Pig
private static class TestEntity extends Pig
{
private final TestEntityPart[] subEntities;
public final TestEntityPart head;
@@ -76,8 +76,8 @@ public class PartEntityTest
private final TestEntityPart tail3;
private final TestEntityPart wing1;
private final TestEntityPart wing2;
public TestEntity(EntityType<? extends Pig> entity, Level world)
public TestEntity(EntityType<? extends Pig> entity, Level world)
{
super(entity, world);
this.head = new TestEntityPart(this, 1.0F, 1.0F);
@@ -92,22 +92,22 @@ public class PartEntityTest
}
@Override
public void aiStep()
public void aiStep()
{
super.aiStep();
for (TestEntityPart part : this.subEntities)
for (TestEntityPart part : this.subEntities)
{
part.setPos(this.getX(), this.getY(), this.getZ());
}
Vec3[] vec3 = new Vec3[this.subEntities.length];
for(int j = 0; j < this.subEntities.length; ++j)
for(int j = 0; j < this.subEntities.length; ++j)
{
vec3[j] = new Vec3(this.subEntities[j].getX(), this.subEntities[j].getY(), this.subEntities[j].getZ());
}
for(int l = 0; l < this.subEntities.length; ++l)
for(int l = 0; l < this.subEntities.length; ++l)
{
this.subEntities[l].xo = vec3[l].x;
this.subEntities[l].yo = vec3[l].y;
@@ -119,24 +119,24 @@ public class PartEntityTest
}
@Override
public boolean isMultipartEntity()
public boolean isMultipartEntity()
{
return true;
}
@Override
public PartEntity<?>[] getParts()
public PartEntity<?>[] getParts()
{
return this.subEntities;
}
@Override
public void recreateFromPacket(ClientboundAddMobPacket packet)
public void recreateFromPacket(ClientboundAddEntityPacket packet)
{
super.recreateFromPacket(packet);
PartEntity<?>[] parts = this.getParts();
for(int i = 0; i < parts.length; ++i)
for(int i = 0; i < parts.length; ++i)
{
parts[i].setId(i + packet.getId());
}
@@ -144,12 +144,12 @@ public class PartEntityTest
}
}
private static class TestEntityPart extends PartEntity<TestEntity>
private static class TestEntityPart extends PartEntity<TestEntity>
{
public final TestEntity parent;
private final EntityDimensions size;
public TestEntityPart(TestEntity parent, float width, float height)
public TestEntityPart(TestEntity parent, float width, float height)
{
super(parent);
this.size = EntityDimensions.scalable(width, height);
@@ -163,32 +163,32 @@ public class PartEntityTest
protected void addAdditionalSaveData(CompoundTag nbt) {}
public boolean isPickable()
public boolean isPickable()
{
return true;
}
public boolean hurt(DamageSource source, float amount)
public boolean hurt(DamageSource source, float amount)
{
return !this.isInvulnerableTo(source) && this.parent.hurt(source, amount);
}
public boolean is(Entity entity)
public boolean is(Entity entity)
{
return this == entity || this.parent == entity;
}
public Packet<?> getAddEntityPacket()
public Packet<?> getAddEntityPacket()
{
throw new UnsupportedOperationException();
}
public EntityDimensions getDimensions(Pose matrix)
public EntityDimensions getDimensions(Pose matrix)
{
return this.size;
}
public boolean shouldBeSaved()
public boolean shouldBeSaved()
{
return false;
}
@@ -5,7 +5,7 @@
package net.minecraftforge.debug.entity.player;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.Component;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
@@ -20,6 +20,6 @@ public class PlayerNameEventTest
public static void onPlayerNameEvent(PlayerEvent.NameFormat event)
{
if (!ENABLE) return;
event.setDisplayname(new TextComponent("Test Name"));
event.setDisplayname(Component.literal("Test Name"));
}
}