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
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ protected <T extends Future<T>> T internalCall(

syncTasks[1] = () -> {
Iterator<FaweCompoundTag> iterator = entities.iterator();
// TODO: TheMeinerLP: Add LeashKnot again
while (iterator.hasNext()) {
final FaweCompoundTag nativeTag = iterator.next();
final LinCompoundTag linTag = nativeTag.linTag();
Expand All @@ -675,6 +676,7 @@ protected <T extends Future<T>> T internalCall(
Entity entity = type.create(nmsWorld);
if (entity != null) {
final CompoundTag tag = (CompoundTag) adapter.fromNativeLin(linTag);
// TODO: TheMeinerLP: Add LeashKnot again
for (final String name : Constants.NO_COPY_ENTITY_NBT_FIELDS) {
tag.remove(name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,12 +676,14 @@ protected <T extends Future<T>> T internalCall(
if (entity != null) {
final net.minecraft.nbt.CompoundTag tag = (net.minecraft.nbt.CompoundTag) adapter.fromNativeLin(
linTag);
// TODO: TheMeinerLP: Add LeashKnot again
for (final String name : Constants.NO_COPY_ENTITY_NBT_FIELDS) {
tag.remove(name);
}
entity.load(tag);
entity.absMoveTo(x, y, z, yaw, pitch);
entity.setUUID(NbtUtils.uuid(nativeTag));
// TODO: TheMeinerLP: Add LeashKnot again
if (!nmsWorld.addFreshEntity(entity, CreatureSpawnEvent.SpawnReason.CUSTOM)) {
LOGGER.warn(
"Error creating entity of type `{}` in world `{}` at location `{},{},{}`",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ protected <T extends Future<T>> T internalCall(

syncTasks[1] = () -> {
Iterator<FaweCompoundTag> iterator = entities.iterator();
// TODO: TheMeinerLP: Add LeashKnot again
while (iterator.hasNext()) {
final FaweCompoundTag nativeTag = iterator.next();
final LinCompoundTag linTag = nativeTag.linTag();
Expand All @@ -677,12 +678,14 @@ protected <T extends Future<T>> T internalCall(
if (entity != null) {
final net.minecraft.nbt.CompoundTag tag = (net.minecraft.nbt.CompoundTag) adapter.fromNativeLin(
linTag);
// TODO: TheMeinerLP: Add LeashKnot again
for (final String name : Constants.NO_COPY_ENTITY_NBT_FIELDS) {
tag.remove(name);
}
entity.load(tag);
entity.absMoveTo(x, y, z, yaw, pitch);
entity.setUUID(NbtUtils.uuid(nativeTag));
// TODO: TheMeinerLP: Add LeashKnot again
if (!nmsWorld.addFreshEntity(entity, CreatureSpawnEvent.SpawnReason.CUSTOM)) {
LOGGER.warn(
"Error creating entity of type `{}` in world `{}` at location `{},{},{}`",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ protected <T extends Future<T>> T internalCall(

syncTasks[1] = () -> {
Iterator<FaweCompoundTag> iterator = entities.iterator();
// TODO: TheMeinerLP: Add LeashKnot again
while (iterator.hasNext()) {
final FaweCompoundTag nativeTag = iterator.next();
final LinCompoundTag linTag = nativeTag.linTag();
Expand All @@ -674,12 +675,14 @@ protected <T extends Future<T>> T internalCall(
Entity entity = type.create(nmsWorld);
if (entity != null) {
final CompoundTag tag = (CompoundTag) adapter.fromNativeLin(linTag);
// TODO: TheMeinerLP: Add LeashKnot again
for (final String name : Constants.NO_COPY_ENTITY_NBT_FIELDS) {
tag.remove(name);
}
entity.load(tag);
entity.absMoveTo(x, y, z, yaw, pitch);
entity.setUUID(NbtUtils.uuid(nativeTag));
// TODO: TheMeinerLP: Add LeashKnot again
if (!nmsWorld.addFreshEntity(entity, CreatureSpawnEvent.SpawnReason.CUSTOM)) {
LOGGER.warn(
"Error creating entity of type `{}` in world `{}` at location `{},{},{}`",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ default Entity createEntity(Location location, BaseEntity entity, UUID uuid) {
posList.add(LinDoubleTag.of(location.y()));
posList.add(LinDoubleTag.of(location.z()));
map.put("Pos", LinListTag.of(LinTagType.doubleTag(), posList));

// Todo: Add again rotation
NbtUtils.addUUIDToMap(map, uuid);

chunk.entity(FaweCompoundTag.of(LinCompoundTag.of(map)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
import com.fastasyncworldedit.core.function.visitor.Order;
import com.fastasyncworldedit.core.queue.Filter;
import com.fastasyncworldedit.core.util.MaskTraverser;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.IntTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.EditSessionBuilder;
import com.sk89q.worldedit.WorldEdit;
Expand All @@ -49,6 +52,7 @@
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.entity.EntityTypes;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand All @@ -59,6 +63,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
import java.util.HashMap;
import java.util.Iterator;
import java.util.UUID;

Expand Down
Loading