Skip to content
Merged
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 @@ -286,8 +286,8 @@ private static void readTagIntoEntity(net.minecraft.nbt.CompoundTag tag, Entity
* @param entity the entity
* @param tag the tag
*/
private static void readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag tag) {
entity.save(tag);
private static boolean readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag tag) {
return entity.save(tag);
}

private static Block getBlockFromType(BlockType blockType) {
Expand Down Expand Up @@ -482,7 +482,9 @@ public BaseEntity getEntity(org.bukkit.entity.Entity entity) {
String id = getEntityId(mcEntity);

net.minecraft.nbt.CompoundTag tag = new net.minecraft.nbt.CompoundTag();
readEntityIntoTag(mcEntity, tag);
if (!readEntityIntoTag(mcEntity, tag)) {
return null;
}
return new BaseEntity(
com.sk89q.worldedit.world.entity.EntityTypes.get(id),
LazyReference.from(() -> (LinCompoundTag) toNativeLin(tag))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ private static String getEntityId(Entity entity) {
return resourceLocation == null ? null : resourceLocation.toString();
}

private static void readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag compoundTag) {
entity.save(compoundTag);
private static boolean readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag compoundTag) {
return entity.save(compoundTag);
}

@Override
Expand Down Expand Up @@ -334,7 +334,9 @@ public BaseEntity getEntity(org.bukkit.entity.Entity entity) {
EntityType type = com.sk89q.worldedit.world.entity.EntityTypes.get(id);
Supplier<LinCompoundTag> saveTag = () -> {
final net.minecraft.nbt.CompoundTag minecraftTag = new net.minecraft.nbt.CompoundTag();
readEntityIntoTag(mcEntity, minecraftTag);
if (!readEntityIntoTag(mcEntity, minecraftTag)) {
return null;
}
//add Id for AbstractChangeSet to work
final LinCompoundTag tag = (LinCompoundTag) toNativeLin(minecraftTag);
final Map<String, LinTag<?>> tags = NbtUtils.getLinCompoundTagValues(tag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ private static void readTagIntoEntity(net.minecraft.nbt.CompoundTag tag, Entity
* @param entity the entity
* @param tag the tag
*/
private static void readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag tag) {
entity.save(tag);
private static boolean readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag tag) {
return entity.save(tag);
}

private static Block getBlockFromType(BlockType blockType) {
Expand Down Expand Up @@ -481,7 +481,9 @@ public BaseEntity getEntity(org.bukkit.entity.Entity entity) {
String id = getEntityId(mcEntity);

net.minecraft.nbt.CompoundTag tag = new net.minecraft.nbt.CompoundTag();
readEntityIntoTag(mcEntity, tag);
if (!readEntityIntoTag(mcEntity, tag)) {
return null;
}
return new BaseEntity(
com.sk89q.worldedit.world.entity.EntityTypes.get(id),
LazyReference.from(() -> (LinCompoundTag) toNativeLin(tag))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ private static String getEntityId(Entity entity) {
return resourceLocation == null ? null : resourceLocation.toString();
}

private static void readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag compoundTag) {
entity.save(compoundTag);
private static boolean readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag compoundTag) {
return entity.save(compoundTag);
}

@Override
Expand Down Expand Up @@ -333,7 +333,9 @@ public BaseEntity getEntity(org.bukkit.entity.Entity entity) {
EntityType type = com.sk89q.worldedit.world.entity.EntityTypes.get(id);
Supplier<LinCompoundTag> saveTag = () -> {
final net.minecraft.nbt.CompoundTag minecraftTag = new net.minecraft.nbt.CompoundTag();
readEntityIntoTag(mcEntity, minecraftTag);
if (!readEntityIntoTag(mcEntity, minecraftTag)) {
return null;
}
//add Id for AbstractChangeSet to work
final LinCompoundTag tag = (LinCompoundTag) toNativeLin(minecraftTag);
final Map<String, LinTag<?>> tags = NbtUtils.getLinCompoundTagValues(tag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ private static void readTagIntoEntity(net.minecraft.nbt.CompoundTag tag, Entity
* @param entity the entity
* @param tag the tag
*/
private static void readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag tag) {
entity.save(tag);
private static boolean readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag tag) {
return entity.save(tag);
}

private static Block getBlockFromType(BlockType blockType) {
Expand Down Expand Up @@ -489,7 +489,9 @@ public BaseEntity getEntity(org.bukkit.entity.Entity entity) {
String id = getEntityId(mcEntity);

net.minecraft.nbt.CompoundTag tag = new net.minecraft.nbt.CompoundTag();
readEntityIntoTag(mcEntity, tag);
if (!readEntityIntoTag(mcEntity, tag)) {
return null;
}
return new BaseEntity(
com.sk89q.worldedit.world.entity.EntityTypes.get(id),
LazyReference.from(() -> (LinCompoundTag) toNativeLin(tag))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ private static String getEntityId(Entity entity) {
return resourceLocation == null ? null : resourceLocation.toString();
}

private static void readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag compoundTag) {
entity.save(compoundTag);
private static boolean readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag compoundTag) {
return entity.save(compoundTag);
}

@Override
Expand Down Expand Up @@ -343,7 +343,9 @@ public BaseEntity getEntity(org.bukkit.entity.Entity entity) {
EntityType type = com.sk89q.worldedit.world.entity.EntityTypes.get(id);
Supplier<LinCompoundTag> saveTag = () -> {
final net.minecraft.nbt.CompoundTag minecraftTag = new net.minecraft.nbt.CompoundTag();
readEntityIntoTag(mcEntity, minecraftTag);
if (!readEntityIntoTag(mcEntity, minecraftTag)) {
return null;
}
//add Id for AbstractChangeSet to work
final LinCompoundTag tag = (LinCompoundTag) toNativeLin(minecraftTag);
final Map<String, LinTag<?>> tags = NbtUtils.getLinCompoundTagValues(tag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ private static void readTagIntoEntity(net.minecraft.nbt.CompoundTag tag, Entity
* @param entity the entity
* @param tag the tag
*/
private static void readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag tag) {
entity.save(tag);
private static boolean readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag tag) {
return entity.save(tag);
}

private static Block getBlockFromType(BlockType blockType) {
Expand Down Expand Up @@ -476,15 +476,12 @@ public BaseEntity getEntity(org.bukkit.entity.Entity entity) {
CraftEntity craftEntity = ((CraftEntity) entity);
Entity mcEntity = craftEntity.getHandle();

// Do not allow creating of passenger entity snapshots, passengers are included in the vehicle entity
if (mcEntity.isPassenger()) {
return null;
}

String id = getEntityId(mcEntity);

net.minecraft.nbt.CompoundTag tag = new net.minecraft.nbt.CompoundTag();
readEntityIntoTag(mcEntity, tag);
if (!readEntityIntoTag(mcEntity, tag)) {
return null;
}
return new BaseEntity(
EntityTypes.get(id),
LazyReference.from(() -> (LinCompoundTag) toNativeLin(tag))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ private static String getEntityId(Entity entity) {
return resourceLocation == null ? null : resourceLocation.toString();
}

private static void readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag compoundTag) {
entity.save(compoundTag);
private static boolean readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag compoundTag) {
return entity.save(compoundTag);
}

@Override
Expand Down Expand Up @@ -343,7 +343,9 @@ public BaseEntity getEntity(org.bukkit.entity.Entity entity) {
EntityType type = com.sk89q.worldedit.world.entity.EntityTypes.get(id);
Supplier<LinCompoundTag> saveTag = () -> {
final net.minecraft.nbt.CompoundTag minecraftTag = new net.minecraft.nbt.CompoundTag();
readEntityIntoTag(mcEntity, minecraftTag);
if (!readEntityIntoTag(mcEntity, minecraftTag)) {
return null;
}
//add Id for AbstractChangeSet to work
final LinCompoundTag tag = (LinCompoundTag) toNativeLin(minecraftTag);
final Map<String, LinTag<?>> tags = NbtUtils.getLinCompoundTagValues(tag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ private static void readTagIntoEntity(net.minecraft.nbt.CompoundTag tag, Entity
* @param entity the entity
* @param tag the tag
*/
private static void readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag tag) {
entity.save(tag);
private static boolean readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag tag) {
return entity.save(tag);
}

private static Block getBlockFromType(BlockType blockType) {
Expand Down Expand Up @@ -465,15 +465,12 @@ public BaseEntity getEntity(org.bukkit.entity.Entity entity) {
CraftEntity craftEntity = ((CraftEntity) entity);
Entity mcEntity = craftEntity.getHandle();

// Do not allow creating of passenger entity snapshots, passengers are included in the vehicle entity
if (mcEntity.isPassenger()) {
return null;
}

String id = getEntityId(mcEntity);

net.minecraft.nbt.CompoundTag tag = new net.minecraft.nbt.CompoundTag();
readEntityIntoTag(mcEntity, tag);
if (!readEntityIntoTag(mcEntity, tag)) {
return null;
}
return new BaseEntity(
EntityTypes.get(id),
LazyReference.from(() -> (LinCompoundTag) toNativeLin(tag))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ private static String getEntityId(Entity entity) {
return net.minecraft.world.entity.EntityType.getKey(entity.getType()).toString();
}

private static void readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag compoundTag) {
entity.save(compoundTag);
private static boolean readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag compoundTag) {
return entity.save(compoundTag);
}

@Override
Expand Down Expand Up @@ -327,7 +327,9 @@ public BaseEntity getEntity(org.bukkit.entity.Entity entity) {
EntityType type = com.sk89q.worldedit.world.entity.EntityTypes.get(id);
Supplier<LinCompoundTag> saveTag = () -> {
final net.minecraft.nbt.CompoundTag minecraftTag = new net.minecraft.nbt.CompoundTag();
readEntityIntoTag(mcEntity, minecraftTag);
if (!readEntityIntoTag(mcEntity, minecraftTag)) {
return null;
}
//add Id for AbstractChangeSet to work
final LinCompoundTag tag = (LinCompoundTag) toNativeLin(minecraftTag);
final Map<String, LinTag<?>> tags = NbtUtils.getLinCompoundTagValues(tag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ repositories {

dependencies {
// https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.5-R0.1-20250412.175117-4")
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.5-R0.1-20250509.154041-75")
compileOnly(libs.paperlib)
}
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ private static String getEntityId(Entity entity) {
* @param entity the entity
* @param tag the tag
*/
private static void readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag tag) {
entity.save(tag);
private static boolean readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag tag) {
return entity.save(tag);
}

private static Block getBlockFromType(BlockType blockType) {
Expand Down Expand Up @@ -457,15 +457,12 @@ public BaseEntity getEntity(org.bukkit.entity.Entity entity) {
CraftEntity craftEntity = ((CraftEntity) entity);
Entity mcEntity = craftEntity.getHandle();

// Do not allow creating of passenger entity snapshots, passengers are included in the vehicle entity
if (mcEntity.isPassenger()) {
return null;
}

String id = getEntityId(mcEntity);

net.minecraft.nbt.CompoundTag tag = new net.minecraft.nbt.CompoundTag();
readEntityIntoTag(mcEntity, tag);
if (!readEntityIntoTag(mcEntity, tag)) {
return null;
}
return new BaseEntity(
EntityTypes.get(id),
LazyReference.from(() -> (LinCompoundTag) toNativeLin(tag))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ private static String getEntityId(Entity entity) {
return net.minecraft.world.entity.EntityType.getKey(entity.getType()).toString();
}

private static void readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag compoundTag) {
entity.save(compoundTag);
private static boolean readEntityIntoTag(Entity entity, net.minecraft.nbt.CompoundTag compoundTag) {
return entity.save(compoundTag);
}

@Override
Expand Down Expand Up @@ -327,7 +327,9 @@ public BaseEntity getEntity(org.bukkit.entity.Entity entity) {
EntityType type = com.sk89q.worldedit.world.entity.EntityTypes.get(id);
Supplier<LinCompoundTag> saveTag = () -> {
final net.minecraft.nbt.CompoundTag minecraftTag = new net.minecraft.nbt.CompoundTag();
readEntityIntoTag(mcEntity, minecraftTag);
if (!readEntityIntoTag(mcEntity, minecraftTag)) {
return null;
}
//add Id for AbstractChangeSet to work
final LinCompoundTag tag = (LinCompoundTag) toNativeLin(minecraftTag);
final Map<String, LinTag<?>> tags = NbtUtils.getLinCompoundTagValues(tag);
Expand Down
Loading
Loading