mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +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
@@ -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