Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ java.sourceCompatibility = JavaVersion.VERSION_25

group = "com.github.SkriptDev"
val projectVersion = "1.7.0"
val hytaleVersion = "0.5.0"
val hytaleVersion = "0.6.0-pre.6"
// You can find Hytale versions on their maven repo:
// https://maven.hytale.com/release/com/hypixel/hytale/Server/maven-metadata.xml
// https://maven.hytale.com/pre-release/com/hypixel/hytale/Server/maven-metadata.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ public void damage(@Nullable LivingEntity performer, @Nullable ItemStack itemSta
null,
damage,
0,
false,
ref,
commandBuffer,
chunkStore);
Expand All @@ -277,6 +278,7 @@ public void damage(@Nullable LivingEntity performer, @Nullable ItemStack itemSta
false,
damage,
0,
false,
ref,
commandBuffer,
chunkStore);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,11 @@ public static void clearMarkedEntity(NPCEntity npcEntity) {
public static void clearMarkedEntity(NPCEntity npcEntity, @Nullable Entity target) {
Role role = npcEntity.getRole();
assert role != null;
MarkedEntitySupport markedEntitySupport = role.getMarkedEntitySupport();

Ref<EntityStore> npcRef = npcEntity.getReference();
if (npcRef == null) return;

MarkedEntitySupport markedEntitySupport = MarkedEntitySupport.get(npcRef, npcRef.getStore());
if (target != null) {
Ref<EntityStore> reference = target.getReference();
assert reference != null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.github.skriptdev.skript.plugin.elements.effects.entity;

import com.github.skriptdev.skript.api.skript.registration.SkriptRegistration;
import com.hypixel.hytale.component.Ref;
import com.hypixel.hytale.server.core.modules.interaction.interaction.config.Interaction;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.server.npc.entities.NPCEntity;
import com.hypixel.hytale.server.npc.role.Role;
import com.hypixel.hytale.server.npc.role.support.CombatSupport;
Expand Down Expand Up @@ -48,11 +50,14 @@ protected void execute(@NotNull TriggerContext ctx) {
interaction = this.interaction.getSingle(ctx).orElse(null);
}

for (NPCEntity entity : this.npcs.getArray(ctx)) {
Role role = entity.getRole();
for (NPCEntity npcEntity : this.npcs.getArray(ctx)) {
Role role = npcEntity.getRole();
assert role != null;

CombatSupport combatSupport = role.getCombatSupport();
Ref<EntityStore> npcRef = npcEntity.getReference();
if (npcRef == null) continue;

CombatSupport combatSupport = CombatSupport.get(npcRef, npcRef.getStore());
if (interaction == null) {
combatSupport.clearAttackOverrides();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ protected void execute(@NotNull TriggerContext ctx) {
Role npcRole = npcEntity.getRole();
if (npcRole == null) continue;

WorldSupport worldSupport = npcRole.getWorldSupport();
Ref<EntityStore> npcRef = npcEntity.getReference();
if (npcRef == null) continue;

WorldSupport worldSupport = WorldSupport.get(npcRef, npcRef.getStore());

for (Entity target : this.targets.getArray(ctx)) {
Ref<EntityStore> targetRef = target.getReference();
if (targetRef == null) continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.hypixel.hytale.component.CommandBuffer;
import com.hypixel.hytale.component.Store;
import com.hypixel.hytale.math.vector.Location;
import com.hypixel.hytale.math.vector.Rotation3f;
import com.hypixel.hytale.server.core.asset.type.item.config.ItemTool;
import com.hypixel.hytale.server.core.asset.type.item.config.ItemToolSpec;
import com.hypixel.hytale.server.core.entity.ExplosionConfig;
Expand Down Expand Up @@ -97,6 +98,7 @@ protected void execute(@NotNull TriggerContext ctx) {

ExplosionUtils.performExplosion(ExplodeInteraction.DAMAGE_SOURCE_EXPLOSION,
location.getPosition(),
new Rotation3f(),
config,
null,
commandBuffer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.github.skriptdev.skript.api.skript.registration.SkriptRegistration;
import com.hypixel.hytale.component.Ref;
import com.hypixel.hytale.component.Store;
import com.hypixel.hytale.server.core.asset.type.attitude.Attitude;
import com.hypixel.hytale.server.core.entity.Entity;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
Expand Down Expand Up @@ -51,8 +52,10 @@ public Attitude[] getValues(@NotNull TriggerContext ctx) {
Ref<EntityStore> targetRef = target.getReference();
if (npcRef == null || targetRef == null) return null;

WorldSupport worldSupport = role.getWorldSupport();
Attitude attitude = worldSupport.getAttitude(npcRef, targetRef, npcRef.getStore());
Store<EntityStore> store = npcRef.getStore();

WorldSupport worldSupport = WorldSupport.get(npcRef, store);
Attitude attitude = worldSupport.getAttitude(npcRef, targetRef, store);
return new Attitude[]{attitude};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ public void change(@NotNull TriggerContext ctx, @NotNull ChangeMode changeMode,
for (NPCEntity npc : this.npcentities.getArray(ctx)) {
Role role = npc.getRole();
assert role != null;
MarkedEntitySupport markedEntitySupport = role.getMarkedEntitySupport();
Ref<EntityStore> npcRef = npc.getReference();
if (npcRef == null) continue;

MarkedEntitySupport markedEntitySupport = MarkedEntitySupport.get(npcRef, npcRef.getStore());
markedEntitySupport.setMarkedEntity("LockedTarget", ref);
}
}
Expand All @@ -95,11 +98,14 @@ public String toString(@NotNull TriggerContext ctx, boolean debug) {

private List<Ref<EntityStore>> getRefs(TriggerContext ctx) {
List<Ref<EntityStore>> refs = new ArrayList<>();
for (NPCEntity entity : this.npcentities.getArray(ctx)) {
Role role = entity.getRole();
for (NPCEntity npcEntity : this.npcentities.getArray(ctx)) {
Role role = npcEntity.getRole();
assert role != null;

MarkedEntitySupport markedEntitySupport = role.getMarkedEntitySupport();
Ref<EntityStore> npcRef = npcEntity.getReference();
if (npcRef == null) continue;

MarkedEntitySupport markedEntitySupport = MarkedEntitySupport.get(npcRef, npcRef.getStore());
Ref<EntityStore> lockedTarget = markedEntitySupport.getMarkedEntityRef("LockedTarget");
refs.add(lockedTarget);
}
Expand Down
Loading