Skip to content

Commit

Permalink
add child classes to ticking lists
Browse files Browse the repository at this point in the history
  • Loading branch information
UpcraftLP committed Dec 31, 2024
1 parent a6a33c2 commit 4ce8c37
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ private static synchronized ComponentContainer.Factory<BlockEntity> getBeCompone
@SuppressWarnings("unchecked") var superclass = (Class<? extends BlockEntity>) entityClass.getSuperclass();
assert BlockEntity.class.isAssignableFrom(superclass) : "requiresStaticFactory returned false on BlockEntity?";
factory = /* recursive call */ getBeComponentFactory(superclass);

// if parent class needs to tick, this one does, too!
if(StaticBlockComponentPlugin.INSTANCE.clientTicking.contains(superclass)) StaticBlockComponentPlugin.INSTANCE.clientTicking.add(entityClass);
if(StaticBlockComponentPlugin.INSTANCE.serverTicking.contains(superclass)) StaticBlockComponentPlugin.INSTANCE.serverTicking.add(entityClass);
}
entityContainerFactories.put(entityClass, factory);
return factory;
Expand Down

0 comments on commit 4ce8c37

Please sign in to comment.