Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c4bdedd
funny draft
acikek Oct 19, 2022
b9b1a0a
g
acikek Oct 19, 2022
6e53820
Merge branch 'main' into attach
tal5 Dec 3, 2022
5a90ace
`EntityTag` to `objects` , update `ClientTagBase`
tal5 Dec 4, 2022
0ed8bc1
Merge branch 'main' into attach
tal5 Dec 4, 2022
047a355
`EntityTag` cleanup and fixes
tal5 Dec 4, 2022
ec01f1f
Fix `AttachCommand` param
tal5 Dec 4, 2022
ceee245
Cleanup imports
tal5 Dec 5, 2022
b35468c
`client.self_entity`
tal5 Dec 5, 2022
f88cc7f
Fixup `attach` command
tal5 Dec 5, 2022
4927417
Merge branch 'main' into attach
acikek Jan 6, 2023
3280c05
actually make rendering work well i think
acikek Jan 6, 2023
abdf37b
Fix repository order
tal5 Jan 7, 2023
4d44a6c
Implement `debuggable` in `EntityTag`
tal5 Jan 9, 2023
a21f4bd
Revert "Implement `debuggable` in `EntityTag`"
tal5 Jan 9, 2023
417cb32
Implement `debuggable` in `EntityTag`
tal5 Jan 9, 2023
c9e741f
Fix attaching entities to other entities
tal5 Jan 9, 2023
055bf15
Attempted lighting improvment
tal5 Jan 9, 2023
29ba868
Merge branch 'main' into attach
tal5 Jan 9, 2023
865da19
Remove leftover
tal5 Jan 9, 2023
3ff18f0
Merge branch 'main' into attach
tal5 Jan 10, 2023
575cc53
Fix lighting issues with attach
tal5 Jan 13, 2023
9c477f0
Supress unchecked cast warning. remove old code
tal5 Jan 13, 2023
40b7f24
Minor `EntityTag` cleanups
tal5 Jan 13, 2023
165eb5f
experimental args for attach
acikek Jan 13, 2023
8f02565
Register `attached` feature renderer using API
tal5 Jan 13, 2023
d98e620
Prevent rotation for attached entities
tal5 Jan 13, 2023
7894a32
Supress warning in previous commit
tal5 Jan 13, 2023
03ceb06
Improve `EntityTag#debuggable`
tal5 Jan 15, 2023
feaaa97
Implement `client.flag` tags
tal5 Jan 15, 2023
eadfbeb
Merge branch 'main' into attach
tal5 Jan 15, 2023
e6813e7
Merge branch 'main' into attach
tal5 Jan 15, 2023
cd40ac3
Merge branch 'main' into attach
tal5 Feb 5, 2023
cb68791
Remove old code
tal5 Feb 5, 2023
65ebf1a
Replace Tabs
tal5 Feb 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
g
  • Loading branch information
acikek committed Oct 19, 2022
commit b9b1a0a71d3141cc878a279ea4407b2d676ff01f
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ public void registerTags() {
}
return list;
});

tagProcessor.registerTag(EntityTag.class, "target", (attribute, object) -> {
System.out.println(MinecraftClient.getInstance().targetedEntity);
return new EntityTag(MinecraftClient.getInstance().targetedEntity);
});
}
}
31 changes: 30 additions & 1 deletion src/main/java/com/denizenscript/clientizen/tags/EntityTag.java
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;

Expand All @@ -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)));
Copy link
Copy Markdown
Member

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

}
if (tagContext == null || tagContext.showErrors()) {
Debug.log("valueOf EntityTag returning null: " + string);
}
return null;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing matches method

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also missing getObjectAttribute implementation

public Entity getEntity() {
Expand All @@ -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
Expand Down