diff --git a/assets/Enderman/Enderman.blockymodel b/assets/Enderman/Enderman.blockymodel new file mode 100644 index 0000000..436f455 --- /dev/null +++ b/assets/Enderman/Enderman.blockymodel @@ -0,0 +1,314 @@ +{ + "nodes": [ + { + "id": "1", + "name": "legright", + "position": {"x": -16, "y": 62, "z": 0}, + "orientation": {"x": 0, "y": 0, "z": 0, "w": 1}, + "shape": { + "type": "box", + "offset": {"x": 8, "y": -28.19108, "z": 5.29767}, + "stretch": {"x": 1, "y": 1, "z": 1}, + "settings": { + "isPiece": false, + "size": {"x": 6, "y": 66, "z": 9} + }, + "textureLayout": { + "back": { + "offset": {"x": 18, "y": 103}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "right": { + "offset": {"x": 76, "y": 77}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "front": { + "offset": {"x": 24, "y": 103}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "left": { + "offset": {"x": 85, "y": 26}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "top": { + "offset": {"x": 72, "y": 35}, + "mirror": {"x": true, "y": true}, + "angle": 0 + }, + "bottom": { + "offset": {"x": 72, "y": 35}, + "mirror": {"x": true, "y": false}, + "angle": 0 + } + }, + "unwrapMode": "custom", + "visible": true, + "doubleSided": false, + "shadingMode": "flat" + } + }, + { + "id": "2", + "name": "cube", + "position": {"x": 0, "y": 82, "z": 5}, + "orientation": {"x": 0, "y": 0, "z": 0, "w": 1}, + "shape": { + "type": "box", + "offset": {"x": -0.5, "y": 0.5, "z": 0}, + "stretch": {"x": 1, "y": 1, "z": 1}, + "settings": { + "isPiece": false, + "size": {"x": 33, "y": 51, "z": 12}, + "isStaticBox": true + }, + "textureLayout": { + "back": { + "offset": {"x": 0, "y": 0}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "right": { + "offset": {"x": 52, "y": 77}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "front": { + "offset": {"x": 33, "y": 0}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "left": { + "offset": {"x": 64, "y": 77}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "top": { + "offset": {"x": 136, "y": 78}, + "mirror": {"x": true, "y": true}, + "angle": 0 + }, + "bottom": { + "offset": {"x": 136, "y": 78}, + "mirror": {"x": true, "y": false}, + "angle": 0 + } + }, + "unwrapMode": "custom", + "visible": true, + "doubleSided": false, + "shadingMode": "flat" + } + }, + { + "id": "3", + "name": "cube", + "position": {"x": 0, "y": 124, "z": -8}, + "orientation": {"x": 0, "y": 0, "z": 0, "w": 1}, + "shape": { + "type": "box", + "offset": {"x": -1, "y": -3, "z": 12}, + "stretch": {"x": 1, "y": 1, "z": 1}, + "settings": { + "isPiece": false, + "size": {"x": 28, "y": 26, "z": 26}, + "isStaticBox": true + }, + "textureLayout": { + "back": { + "offset": {"x": 0, "y": 51}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "right": { + "offset": {"x": 0, "y": 77}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "front": { + "offset": {"x": 28, "y": 51}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "left": { + "offset": {"x": 26, "y": 77}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "top": { + "offset": {"x": 84, "y": 77}, + "mirror": {"x": true, "y": true}, + "angle": 0 + }, + "bottom": { + "offset": {"x": 94, "y": 0}, + "mirror": {"x": true, "y": false}, + "angle": 0 + } + }, + "unwrapMode": "custom", + "visible": true, + "doubleSided": false, + "shadingMode": "flat" + } + }, + { + "id": "4", + "name": "armright", + "position": {"x": 0, "y": 102, "z": 0}, + "orientation": {"x": 0, "y": 0, "z": 0, "w": 1}, + "shape": { + "type": "box", + "offset": {"x": -20, "y": -27, "z": 4.5}, + "stretch": {"x": 1, "y": 1, "z": 1}, + "settings": { + "isPiece": false, + "size": {"x": 6, "y": 66, "z": 9} + }, + "textureLayout": { + "back": { + "offset": {"x": 109, "y": 90}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "right": { + "offset": {"x": 103, "y": 0}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "front": { + "offset": {"x": 112, "y": 0}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "left": { + "offset": {"x": 9, "y": 103}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "top": { + "offset": {"x": 121, "y": 99}, + "mirror": {"x": true, "y": true}, + "angle": 0 + }, + "bottom": { + "offset": {"x": 121, "y": 99}, + "mirror": {"x": true, "y": false}, + "angle": 0 + } + }, + "unwrapMode": "custom", + "visible": true, + "doubleSided": false, + "shadingMode": "flat" + } + }, + { + "id": "5", + "name": "armleft", + "position": {"x": 0, "y": 104, "z": 0}, + "orientation": {"x": 0, "y": 0, "z": 0, "w": 1}, + "shape": { + "type": "box", + "offset": {"x": 19, "y": -29, "z": 4.5}, + "stretch": {"x": 1, "y": 1, "z": 1}, + "settings": { + "isPiece": false, + "size": {"x": 6, "y": 66, "z": 9} + }, + "textureLayout": { + "back": { + "offset": {"x": 42, "y": 103}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "right": { + "offset": {"x": 94, "y": 66}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "front": { + "offset": {"x": 103, "y": 90}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "left": { + "offset": {"x": 0, "y": 103}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "top": { + "offset": {"x": 84, "y": 35}, + "mirror": {"x": true, "y": true}, + "angle": 0 + }, + "bottom": { + "offset": {"x": 84, "y": 35}, + "mirror": {"x": true, "y": false}, + "angle": 0 + } + }, + "unwrapMode": "custom", + "visible": true, + "doubleSided": false, + "shadingMode": "flat" + } + }, + { + "id": "6", + "name": "legleft", + "position": {"x": 0, "y": 63, "z": 0}, + "orientation": {"x": 0, "y": 0, "z": 0, "w": 1}, + "shape": { + "type": "box", + "offset": {"x": 8, "y": -30, "z": 4.5}, + "stretch": {"x": 1, "y": 1, "z": 1}, + "settings": { + "isPiece": false, + "size": {"x": 6, "y": 66, "z": 9} + }, + "textureLayout": { + "back": { + "offset": {"x": 30, "y": 103}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "right": { + "offset": {"x": 85, "y": 92}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "front": { + "offset": {"x": 36, "y": 103}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "left": { + "offset": {"x": 94, "y": 0}, + "mirror": {"x": false, "y": false}, + "angle": 0 + }, + "top": { + "offset": {"x": 78, "y": 35}, + "mirror": {"x": true, "y": true}, + "angle": 0 + }, + "bottom": { + "offset": {"x": 78, "y": 35}, + "mirror": {"x": true, "y": false}, + "angle": 0 + } + }, + "unwrapMode": "custom", + "visible": true, + "doubleSided": false, + "shadingMode": "flat" + } + } + ], + "format": "character", + "lod": "auto" +} \ No newline at end of file diff --git a/assets/Enderman/base.png b/assets/Enderman/base.png new file mode 100644 index 0000000..2d4b210 Binary files /dev/null and b/assets/Enderman/base.png differ diff --git a/assets/Enderman/walk.blockyanim b/assets/Enderman/walk.blockyanim new file mode 100644 index 0000000..757b59c --- /dev/null +++ b/assets/Enderman/walk.blockyanim @@ -0,0 +1,139 @@ +{ + "formatVersion": 1, + "duration": 60, + "holdLastKeyframe": false, + "nodeAnimations": { + "legright": { + "position": [], + "orientation": [ + { + "time": 0, + "delta": {"x": 0, "y": 0, "z": 0, "w": 1}, + "interpolationType": "linear" + }, + { + "time": 15, + "delta": {"x": -0.21644, "y": 0, "z": 0, "w": 0.9763}, + "interpolationType": "linear" + }, + { + "time": 30, + "delta": {"x": 0, "y": 0, "z": 0, "w": 1}, + "interpolationType": "linear" + }, + { + "time": 45, + "delta": {"x": 0.21644, "y": 0, "z": 0, "w": 0.9763}, + "interpolationType": "linear" + }, + { + "time": 60, + "delta": {"x": 0, "y": 0, "z": 0, "w": 1}, + "interpolationType": "linear" + } + ], + "shapeStretch": [], + "shapeVisible": [], + "shapeUvOffset": [] + }, + "armright": { + "position": [], + "orientation": [ + { + "time": 0, + "delta": {"x": 0, "y": 0, "z": 0, "w": 1}, + "interpolationType": "linear" + }, + { + "time": 15, + "delta": {"x": 0.21644, "y": 0, "z": 0, "w": 0.9763}, + "interpolationType": "linear" + }, + { + "time": 30, + "delta": {"x": 0, "y": 0, "z": 0, "w": 1}, + "interpolationType": "linear" + }, + { + "time": 45, + "delta": {"x": -0.21644, "y": 0, "z": 0, "w": 0.9763}, + "interpolationType": "linear" + }, + { + "time": 60, + "delta": {"x": 0, "y": 0, "z": 0, "w": 1}, + "interpolationType": "linear" + } + ], + "shapeStretch": [], + "shapeVisible": [], + "shapeUvOffset": [] + }, + "armleft": { + "position": [], + "orientation": [ + { + "time": 0, + "delta": {"x": 0, "y": 0, "z": 0, "w": 1}, + "interpolationType": "linear" + }, + { + "time": 15, + "delta": {"x": -0.21644, "y": 0, "z": 0, "w": 0.9763}, + "interpolationType": "linear" + }, + { + "time": 30, + "delta": {"x": 0, "y": 0, "z": 0, "w": 1}, + "interpolationType": "linear" + }, + { + "time": 45, + "delta": {"x": 0.21644, "y": 0, "z": 0, "w": 0.9763}, + "interpolationType": "linear" + }, + { + "time": 60, + "delta": {"x": 0, "y": 0, "z": 0, "w": 1}, + "interpolationType": "linear" + } + ], + "shapeStretch": [], + "shapeVisible": [], + "shapeUvOffset": [] + }, + "legleft": { + "position": [], + "orientation": [ + { + "time": 0, + "delta": {"x": 0, "y": 0, "z": 0, "w": 1}, + "interpolationType": "linear" + }, + { + "time": 15, + "delta": {"x": 0.21644, "y": 0, "z": 0, "w": 0.9763}, + "interpolationType": "linear" + }, + { + "time": 30, + "delta": {"x": 0, "y": 0, "z": 0, "w": 1}, + "interpolationType": "linear" + }, + { + "time": 45, + "delta": {"x": -0.21644, "y": 0, "z": 0, "w": 0.9763}, + "interpolationType": "linear" + }, + { + "time": 60, + "delta": {"x": 0, "y": 0, "z": 0, "w": 1}, + "interpolationType": "linear" + } + ], + "shapeStretch": [], + "shapeVisible": [], + "shapeUvOffset": [] + } + } +} \ No newline at end of file diff --git a/src/main/java/com/tikaiz/systems/AddEndermanTeleportComponentTickSystem.java b/src/main/java/com/tikaiz/systems/AddEndermanTeleportComponentTickSystem.java index f682b45..5cbdc28 100644 --- a/src/main/java/com/tikaiz/systems/AddEndermanTeleportComponentTickSystem.java +++ b/src/main/java/com/tikaiz/systems/AddEndermanTeleportComponentTickSystem.java @@ -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 diff --git a/src/main/java/com/tikaiz/systems/DamageEventSystem.java b/src/main/java/com/tikaiz/systems/DamageEventSystem.java index f5e19e6..9f47d15 100644 --- a/src/main/java/com/tikaiz/systems/DamageEventSystem.java +++ b/src/main/java/com/tikaiz/systems/DamageEventSystem.java @@ -27,10 +27,13 @@ public class DamageEventSystem extends EntityEventSystem { @NonNullDecl CommandBuffer commandBuffer, @NonNullDecl Damage damage) { Ref 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); } }