Skip to content

Commit

Permalink
rewrite #16
Browse files Browse the repository at this point in the history
  • Loading branch information
Traben-0 committed Nov 25, 2023
1 parent 658b948 commit 0d8a6f7
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,17 @@ public String getPrintout() {
}

public void checkIfShouldExpireEntity(UUID id) {
//type safe check as returns false if missing

if (suffixProvider.entityCanUpdate(id)
&& ETFConfigData.textureUpdateFrequency_V2 != ETFConfig.UpdateFrequency.Never) {

int delay = ETFConfigData.textureUpdateFrequency_V2.getDelay();
long randomizer = delay * 20L;
if (System.currentTimeMillis() % randomizer == Math.abs(id.hashCode()) % randomizer
) {
//marks texture to update next render if a certain delay time is reached
entitySuffixMap.removeInt(id);
if (suffixProvider.entityCanUpdate(id)) {
switch (ETFConfigData.textureUpdateFrequency_V2){
case Never -> {}
case Instant -> this.entitySuffixMap.removeInt(id);
default -> {
int delay = ETFConfigData.textureUpdateFrequency_V2.getDelay();
int time = (int) (ETFRenderContext.getCurrentEntity().etf$getWorld().getTime() % delay);
if (time == Math.abs(id.hashCode()) % delay) {
this.entitySuffixMap.removeInt(id);
}
}
}
}
}
Expand Down

0 comments on commit 0d8a6f7

Please sign in to comment.