mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 12:20:11 +00:00
Adds some explanatory javadocs and check world in ModelDataManager (#5762)
This commit is contained in:
1 parent
650e7dc16e
commit
06a30e9f23
3 files changed
+13
-1
No files matched your search
@@ -6,7 +6,7 @@
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
-public interface IBakedModel {
|
||||
+public interface IBakedModel extends net.minecraftforge.client.extensions.IForgeBakedModel {
|
||||
+
|
||||
+ /**@deprecated Forge: Use {@link net.minecraftforge.client.extensions.IForgeBakedModel#getQuads(IBlockState, EnumFacing, Random, net.minecraftforge.client.model.data.IModelData)}*/
|
||||
+ @Deprecated
|
||||
List<BakedQuad> func_200117_a(@Nullable BlockState p_200117_1_, @Nullable Direction p_200117_2_, Random p_200117_3_);
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@ public class ModelDataManager
|
||||
|
||||
public static Map<BlockPos, IModelData> getModelData(World world, ChunkPos pos)
|
||||
{
|
||||
Preconditions.checkArgument(world.isRemote, "Asked ModelDataManager from server world!");
|
||||
refreshModelData(world, pos);
|
||||
return modelDataCache.getOrDefault(pos, Collections.emptyMap());
|
||||
}
|
||||
|
||||
@@ -172,6 +172,10 @@ public interface IForgeTileEntity extends ICapabilitySerializable<CompoundNBT>
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests a refresh for the model data of your TE
|
||||
* Call this every time your {@link #getModelData()} changes
|
||||
*/
|
||||
default void requestModelDataUpdate()
|
||||
{
|
||||
TileEntity te = getTileEntity();
|
||||
@@ -182,6 +186,13 @@ public interface IForgeTileEntity extends ICapabilitySerializable<CompoundNBT>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows you to return additional model data.
|
||||
* This data can be used to provide additional functionality in your {@link net.minecraft.client.renderer.model.IBakedModel}
|
||||
* You need to schedule a refresh of you model data via {@link #requestModelDataUpdate()} if the result of this function changes.
|
||||
* <b>Note that this method may be called on a chunk render thread instead of the main client thread</b>
|
||||
* @return Your model data
|
||||
*/
|
||||
default @Nonnull IModelData getModelData()
|
||||
{
|
||||
return EmptyModelData.INSTANCE;
|
||||
|
||||
Reference in new issue
Block a user