Skip to content

Commit

Permalink
Fixed crash with village replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
supermassimo committed Jun 29, 2024
1 parent c4714cd commit 296884e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
modName=DynamicTrees
modId=dynamictrees
modVersion=1.3.0-BETA6
modVersion=1.3.0-BETA7
group=com.ferreusveritas.dynamictrees

mcVersion=1.20.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,7 @@ public Vec3i getSize(StructureTemplateManager pStructureManager, Rotation pRotat
@Override
public boolean place(StructureTemplateManager structureManager, WorldGenLevel level, StructureManager structureFeatureManager, ChunkGenerator chunkGenerator, BlockPos pos, BlockPos p_210488_,
Rotation rotation, BoundingBox box, RandomSource random, boolean keepJigsaws) {
final Seed seed = species.getSeed().orElse(null);
if (seed == null) {
return false;
}

final ItemStack seedStack = new ItemStack(seed);
final CompoundTag tag = new CompoundTag();
tag.putBoolean(Seed.FORCE_PLANT_KEY, true);
tag.putInt(Seed.CODE_KEY, random.nextInt(7) + 2);
tag.putInt(Seed.LIFESPAN_KEY, 0);
seedStack.setTag(tag);

final int posX = pos.getX() + getOffsetX(rotation);
final int posY = pos.getY() + getOffsetY(rotation);
final int posZ = pos.getZ() + getOffsetZ(rotation);
level.addFreshEntity(new ItemEntity(level.getLevel(), posX, posY, posZ, seedStack));
species.plantSapling(level, pos, true);
return true;
}

Expand Down

0 comments on commit 296884e

Please sign in to comment.