-
Notifications
You must be signed in to change notification settings - Fork 8
Attach + EntityTag beginnings #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
acikek
wants to merge
35
commits into
main
Choose a base branch
from
attach
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
c4bdedd
funny draft
acikek b9b1a0a
g
acikek 6e53820
Merge branch 'main' into attach
tal5 5a90ace
`EntityTag` to `objects` , update `ClientTagBase`
tal5 0ed8bc1
Merge branch 'main' into attach
tal5 047a355
`EntityTag` cleanup and fixes
tal5 ec01f1f
Fix `AttachCommand` param
tal5 ceee245
Cleanup imports
tal5 b35468c
`client.self_entity`
tal5 f88cc7f
Fixup `attach` command
tal5 4927417
Merge branch 'main' into attach
acikek 3280c05
actually make rendering work well i think
acikek abdf37b
Fix repository order
tal5 4d44a6c
Implement `debuggable` in `EntityTag`
tal5 a21f4bd
Revert "Implement `debuggable` in `EntityTag`"
tal5 417cb32
Implement `debuggable` in `EntityTag`
tal5 c9e741f
Fix attaching entities to other entities
tal5 055bf15
Attempted lighting improvment
tal5 29ba868
Merge branch 'main' into attach
tal5 865da19
Remove leftover
tal5 3ff18f0
Merge branch 'main' into attach
tal5 575cc53
Fix lighting issues with attach
tal5 9c477f0
Supress unchecked cast warning. remove old code
tal5 40b7f24
Minor `EntityTag` cleanups
tal5 165eb5f
experimental args for attach
acikek 8f02565
Register `attached` feature renderer using API
tal5 d98e620
Prevent rotation for attached entities
tal5 7894a32
Supress warning in previous commit
tal5 03ceb06
Improve `EntityTag#debuggable`
tal5 feaaa97
Implement `client.flag` tags
tal5 eadfbeb
Merge branch 'main' into attach
tal5 e6813e7
Merge branch 'main' into attach
tal5 cd40ac3
Merge branch 'main' into attach
tal5 cb68791
Remove old code
tal5 65ebf1a
Replace Tabs
tal5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
g
- Loading branch information
commit b9b1a0a71d3141cc878a279ea4407b2d676ff01f
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,7 +1,11 @@ | ||
| package com.denizenscript.clientizen.tags; | ||
|
|
||
| import com.denizenscript.denizencore.objects.Fetchable; | ||
| import com.denizenscript.denizencore.objects.ObjectTag; | ||
| import com.denizenscript.denizencore.objects.core.ElementTag; | ||
| import com.denizenscript.denizencore.tags.ObjectTagProcessor; | ||
| import com.denizenscript.denizencore.tags.TagContext; | ||
| import com.denizenscript.denizencore.utilities.debugging.Debug; | ||
| import net.minecraft.client.MinecraftClient; | ||
| import net.minecraft.entity.Entity; | ||
|
|
||
|
|
@@ -11,8 +15,26 @@ public class EntityTag implements ObjectTag { | |
|
|
||
| public UUID uuid; | ||
|
|
||
| public EntityTag(UUID uuid) { | ||
| this.uuid = uuid; | ||
| } | ||
|
|
||
| public EntityTag(Entity entity) { | ||
| uuid = entity.getUuid(); | ||
| this(entity.getUuid()); | ||
| } | ||
|
|
||
| @Fetchable("e") | ||
| public static EntityTag valueOf(String string, TagContext tagContext) { | ||
| if (string == null) { | ||
| return null; | ||
| } | ||
| if (string.startsWith("e@")) { | ||
| return new EntityTag(UUID.fromString(string.substring(2))); | ||
| } | ||
| if (tagContext == null || tagContext.showErrors()) { | ||
| Debug.log("valueOf EntityTag returning null: " + string); | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also missing |
||
| public Entity getEntity() { | ||
|
|
@@ -21,6 +43,13 @@ public Entity getEntity() { | |
|
|
||
| public static ObjectTagProcessor<EntityTag> tagProcessor = new ObjectTagProcessor<>(); | ||
|
|
||
| public static void registerTags() { | ||
|
|
||
| tagProcessor.registerTag(ElementTag.class, "entity_type", (attribute, object) -> { | ||
| return new ElementTag(object.getEntity().getType().getUntranslatedName(), true); | ||
| }); | ||
| } | ||
|
|
||
| private String prefix = "Entity"; | ||
|
|
||
| @Override | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should check if it starts with
e@and substring before doing the UUID conversion, as just a UUID is valid as well