mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 11:59:25 +00:00
Fixed minor race condition between mouse clicks and TESR in the animation example.
This commit is contained in:
1 parent
e929199758
commit
960717eb0c
3 files changed
+24
-2
No files matched your search
@@ -26,6 +26,8 @@ public enum Animation implements IResourceManagerReloadListener
|
||||
{
|
||||
INSTANCE;
|
||||
|
||||
private float clientPartialTickTime;
|
||||
|
||||
/**
|
||||
* Get the global world time for the current tick, in seconds.
|
||||
*/
|
||||
@@ -42,6 +44,14 @@ public enum Animation implements IResourceManagerReloadListener
|
||||
return (world.getTotalWorldTime() + tickProgress) / 20;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current partialTickTime.
|
||||
*/
|
||||
public static float getPartialTickTime()
|
||||
{
|
||||
return INSTANCE.clientPartialTickTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a new instance if AnimationStateMachine at specified location, with specified custom parameters.
|
||||
*/
|
||||
@@ -176,6 +186,16 @@ public enum Animation implements IResourceManagerReloadListener
|
||||
|
||||
private final ModelBlockAnimation defaultModelBlockAnimation = new ModelBlockAnimation(ImmutableMap.<String, ImmutableMap<String, float[]>>of(), ImmutableMap.<String, ModelBlockAnimation.MBClip>of());
|
||||
|
||||
/**
|
||||
* Iternal hook, do not use.
|
||||
*/
|
||||
public static void setClientPartialTickTime(float clientPartialTickTime) {
|
||||
Animation.INSTANCE.clientPartialTickTime = clientPartialTickTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iternal hook, do not use.
|
||||
*/
|
||||
public void onResourceManagerReload(IResourceManager manager)
|
||||
{
|
||||
this.manager = manager;
|
||||
|
||||
Reference in new issue
Block a user