-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
65 additions
and
90 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
src/main/java/dev/tr7zw/exordium/access/BossOverlayAccess.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package dev.tr7zw.exordium.access; | ||
|
||
import java.util.Map; | ||
import java.util.UUID; | ||
|
||
import net.minecraft.client.gui.components.LerpingBossEvent; | ||
|
||
public interface BossOverlayAccess { | ||
|
||
Map<UUID, LerpingBossEvent> getEvents(); | ||
|
||
} |
12 changes: 0 additions & 12 deletions
12
src/main/java/dev/tr7zw/exordium/access/VanillaBufferAccess.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/dev/tr7zw/exordium/components/vanilla/BossHealthBarComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package dev.tr7zw.exordium.components.vanilla; | ||
|
||
import java.util.Map; | ||
import java.util.UUID; | ||
|
||
import dev.tr7zw.exordium.access.BossEventBufferAccess; | ||
import dev.tr7zw.exordium.access.BossOverlayAccess; | ||
import dev.tr7zw.exordium.components.BufferComponent; | ||
import dev.tr7zw.util.NMSHelper; | ||
import lombok.Getter; | ||
import net.minecraft.client.gui.components.LerpingBossEvent; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public class BossHealthBarComponent implements BufferComponent<BossOverlayAccess> { | ||
|
||
@Getter | ||
private static final ResourceLocation id = NMSHelper.getResourceLocation("minecraft", "boss_bar"); | ||
|
||
@Override | ||
public void captureState(BossOverlayAccess context) { | ||
for (LerpingBossEvent value : context.getEvents().values()) { | ||
((BossEventBufferAccess) value).exordium_captureState(); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean hasChanged(int tickCount, BossOverlayAccess context) { | ||
for (LerpingBossEvent value : context.getEvents().values()) { | ||
if (((BossEventBufferAccess) value).exordium_needsRender()) | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters