mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-23 21:49:46 +00:00
Forge 1.19.3
Created a CreativeModeTabEvent to register creative mode tabs and populate entries per tab Moved datapack registries to DataPackRegistryEvent.NewRegistry event instead of tying them to ForgeRegistry Made it easier for mods to datagen datapack builtin entries with DatapackBuiltinEntriesProvider Provided access to lookupProvider for datagen Updated dependencies to match versions used by vanilla and update JarJar to 0.3.18 Added a test mod for the new CreativeModeTabEvent Throws better error message for Forge registries in tag datagen Deleted ForgeRegistryTagsProvider Updated ClientChatReceivedEvent and ServerChatEvent for Mojang changes Added patches for both sign related methods in ModelLayers Changed RegisterShadersEvent to use ResourceProvider Migrated old Mojang math types to JOML Co-authored-by: Marc Hermans <[email protected]> Co-authored-by: LexManos <[email protected]> Co-authored-by: sciwhiz12 <[email protected]> Co-authored-by: coehlrich <[email protected]>
This commit is contained in:
1 parent
617ecb7ad3
commit
8255d7aed3
726 files changed
+7615
-6653
No files matched your search
+2
-2
@@ -6,12 +6,12 @@
|
||||
package net.minecraftforge.client.extensions;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Matrix4f;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.renderer.DimensionSpecialEffects;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import org.joml.Matrix4f;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
/**
|
||||
* Extension interface for {@link DimensionSpecialEffects}.
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) Forge Development LLC and contributors
|
||||
* SPDX-License-Identifier: LGPL-2.1-only
|
||||
*/
|
||||
|
||||
package net.minecraftforge.client.extensions;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.resources.model.BakedModel;
|
||||
import net.minecraft.client.resources.model.Material;
|
||||
import net.minecraft.client.resources.model.ModelState;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import java.util.function.Function;
|
||||
|
||||
public interface IForgeModelBaker
|
||||
{
|
||||
@Nullable
|
||||
BakedModel bake(ResourceLocation location, ModelState state, Function<Material, TextureAtlasSprite> sprites);
|
||||
|
||||
Function<Material, TextureAtlasSprite> getModelTextureGetter();
|
||||
}
|
||||
@@ -7,7 +7,7 @@ package net.minecraftforge.client.extensions;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Transformation;
|
||||
import com.mojang.math.Vector3f;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
/**
|
||||
* Extension interface for {@link com.mojang.blaze3d.vertex.PoseStack}.
|
||||
|
||||
@@ -8,12 +8,12 @@ package net.minecraftforge.client.extensions;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.core.Direction;
|
||||
|
||||
import com.mojang.math.Matrix4f;
|
||||
import com.mojang.math.Transformation;
|
||||
import com.mojang.math.Vector3f;
|
||||
import com.mojang.math.Vector4f;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import org.joml.Matrix4f;
|
||||
import org.joml.Vector3f;
|
||||
import org.joml.Vector4f;
|
||||
|
||||
/**
|
||||
* Extension interface for {@link Transformation}.
|
||||
@@ -58,7 +58,7 @@ public interface IForgeTransformation
|
||||
*/
|
||||
default void transformPosition(Vector4f position)
|
||||
{
|
||||
position.transform(self().getMatrix());
|
||||
position.mul(self().getMatrix());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ public interface IForgeTransformation
|
||||
*/
|
||||
default void transformNormal(Vector3f normal)
|
||||
{
|
||||
normal.transform(self().getNormalMatrix());
|
||||
normal.mul(self().getNormalMatrix());
|
||||
normal.normalize();
|
||||
}
|
||||
|
||||
@@ -120,11 +120,10 @@ public interface IForgeTransformation
|
||||
if (transform.isIdentity()) return Transformation.identity();
|
||||
|
||||
Matrix4f ret = transform.getMatrix();
|
||||
Matrix4f tmp = Matrix4f.createTranslateMatrix(origin.x(), origin.y(), origin.z());
|
||||
ret.multiplyBackward(tmp);
|
||||
tmp.setIdentity();
|
||||
tmp.setTranslation(-origin.x(), -origin.y(), -origin.z());
|
||||
ret.multiply(tmp);
|
||||
Matrix4f tmp = new Matrix4f().translation(origin.x(), origin.y(), origin.z());
|
||||
tmp.mul(ret, ret);
|
||||
tmp.translation(-origin.x(), -origin.y(), -origin.z());
|
||||
ret.mul(tmp);
|
||||
return new Transformation(ret);
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,10 @@ package net.minecraftforge.client.extensions;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import com.mojang.blaze3d.vertex.VertexFormatElement;
|
||||
import com.mojang.math.Matrix3f;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraftforge.client.model.IQuadTransformer;
|
||||
import org.joml.Matrix3f;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
@@ -63,7 +63,7 @@ public interface IForgeVertexConsumer
|
||||
if (nx != 0 || ny != 0 || nz != 0)
|
||||
{
|
||||
generated.set(nx / 127f, ny / 127f, nz / 127f);
|
||||
generated.transform(normalTransform);
|
||||
generated.mul(normalTransform);
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -5,7 +5,6 @@
|
||||
|
||||
package net.minecraftforge.client.extensions.common;
|
||||
|
||||
import com.mojang.math.Vector3d;
|
||||
import net.minecraft.client.particle.ParticleEngine;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
@@ -19,6 +18,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
import org.joml.Vector3d;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -71,7 +71,7 @@ public interface IClientBlockExtensions
|
||||
*/
|
||||
default boolean addDestroyEffects(BlockState state, Level Level, BlockPos pos, ParticleEngine manager)
|
||||
{
|
||||
return false;
|
||||
return !state.shouldSpawnParticlesOnBreak();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+18
-27
@@ -6,21 +6,14 @@
|
||||
package net.minecraftforge.client.extensions.common;
|
||||
|
||||
import com.mojang.blaze3d.shaders.FogShape;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.BufferBuilder;
|
||||
import com.mojang.blaze3d.vertex.BufferUploader;
|
||||
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.Tesselator;
|
||||
import com.mojang.blaze3d.vertex.VertexFormat;
|
||||
import com.mojang.math.Matrix4f;
|
||||
import com.mojang.math.Vector3f;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Stream;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.renderer.FogRenderer;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import net.minecraft.client.renderer.ScreenEffectRenderer;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
@@ -33,10 +26,7 @@ import net.minecraftforge.fluids.FluidType;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Stream;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
/**
|
||||
* {@linkplain LogicalSide#CLIENT Client-only} extensions to {@link FluidType}.
|
||||
@@ -130,19 +120,20 @@ public interface IClientFluidTypeExtensions
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stream of textures applied to a fluid.
|
||||
*
|
||||
* <p>This is used by the {@link net.minecraft.client.resources.model.ModelBakery} to load in all textures that
|
||||
* can be applied on reload.
|
||||
*
|
||||
* @return a stream of textures applied to a fluid
|
||||
*/
|
||||
default Stream<ResourceLocation> getTextures()
|
||||
{
|
||||
return Stream.of(this.getStillTexture(), this.getFlowingTexture(), this.getOverlayTexture())
|
||||
.filter(Objects::nonNull);
|
||||
}
|
||||
// Add entries to assets/minecraft/atlases/blocks.json if your texture location is not already covered by the default atlas search locations.
|
||||
// /**
|
||||
// * Returns a stream of textures applied to a fluid.
|
||||
// *
|
||||
// * <p>This is used by the {@link net.minecraft.client.resources.model.ModelBakery} to load in all textures that
|
||||
// * can be applied on reload.
|
||||
// *
|
||||
// * @return a stream of textures applied to a fluid
|
||||
// */
|
||||
// default Stream<ResourceLocation> getTextures()
|
||||
// {
|
||||
// return Stream.of(this.getStillTexture(), this.getFlowingTexture(), this.getOverlayTexture())
|
||||
// .filter(Objects::nonNull);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Returns the location of the texture to apply to the camera when it is
|
||||
|
||||
Reference in new issue
Block a user