Add Assets

This commit is contained in:
2026-01-21 14:47:09 +01:00
parent fa9b884380
commit 531507ca22
5 changed files with 460 additions and 4 deletions

View File

@@ -29,11 +29,11 @@ public class AddEndermanTeleportComponentTickSystem extends EntityTickingSystem<
assert displayNameComponent != null;
assert displayNameComponent.getDisplayName() != null;
var displayName = displayNameComponent.getDisplayName().getAnsiMessage();
if (!"Bunny".equals(displayName)){
if (!"Enderman".equals(displayName)){
return;
}
commandBuffer.addComponent(ref, endermanComponentType, new EndermanTeleportComponent());
HytaleLogger.getLogger().atInfo().log("Added Component to ref: " + displayName);
// HytaleLogger.getLogger().atInfo().log("Added Component to ref: " + displayName);
}
@NullableDecl

View File

@@ -27,10 +27,13 @@ public class DamageEventSystem extends EntityEventSystem<EntityStore, Damage> {
@NonNullDecl CommandBuffer<EntityStore> commandBuffer,
@NonNullDecl Damage damage) {
Ref<EntityStore> ref = archetypeChunk.getReferenceTo(i);
TransformComponent transformComponent = store.getComponent(ref, TransformComponent.getComponentType());
var transformComponent = store.getComponent(ref, TransformComponent.getComponentType());
assert transformComponent != null;
var endermanComponent = store.getComponent(ref, endermanTeleportComponentType);
assert endermanComponent != null;
if (Math.random() < 0.3) {
endermanComponent.resetElapsedTime();
if (Math.random() < 0.15) {
EndermanTeleport(ref,transformComponent.getPosition(),commandBuffer);
}
}