Skip to content

Commit e5f06a0

Browse files
authored
Worldgen & crop fixes (#10609)
* Improve structures loottables etc * don't spawn error
1 parent 13d7447 commit e5f06a0

21 files changed

+15
-1
lines changed

src/main/java/com/minecolonies/core/items/ItemCrop.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
import com.minecolonies.api.util.MessageUtils;
55
import com.minecolonies.api.util.constant.TranslationConstants;
66
import com.minecolonies.core.blocks.MinecoloniesCropBlock;
7+
import com.minecolonies.core.blocks.MinecoloniesFarmland;
78
import net.minecraft.ChatFormatting;
9+
import net.minecraft.core.BlockPos;
810
import net.minecraft.core.Holder;
911
import net.minecraft.network.chat.Component;
1012
import net.minecraft.tags.TagKey;
@@ -16,6 +18,7 @@
1618
import net.minecraft.world.item.context.BlockPlaceContext;
1719
import net.minecraft.world.level.Level;
1820
import net.minecraft.world.level.biome.Biome;
21+
import net.minecraft.world.level.block.FarmBlock;
1922
import net.minecraft.world.level.block.state.BlockState;
2023
import net.minecraft.world.phys.shapes.CollisionContext;
2124
import org.jetbrains.annotations.NotNull;
@@ -52,7 +55,9 @@ protected boolean canPlace(BlockPlaceContext ctx, @NotNull BlockState state)
5255
Player player = ctx.getPlayer();
5356
if (!player.isCreative())
5457
{
55-
if (ctx.getLevel().isClientSide)
58+
final BlockPos clickedPos = ctx.getClickedPos().below();
59+
final BlockState worldState = ctx.getLevel().getBlockState(clickedPos);
60+
if (ctx.getLevel().isClientSide && (worldState.getBlock() instanceof MinecoloniesFarmland || worldState.getBlock() instanceof FarmBlock))
5661
{
5762
MessageUtils.format(Component.translatable("com.minecolonies.core.crop.cantplant")).sendTo(player);
5863
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/main/resources/data/minecolonies/worldgen/template_pool/amazon_camp.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
"projection": "rigid",
1111
"element_type": "minecraft:single_pool_element"
1212
}
13+
},
14+
{
15+
"weight": 1,
16+
"element": {
17+
"location": "minecolonies:camps/big_amazon_pyramid",
18+
"processors": "minecolonies:placeholder_replacement",
19+
"projection": "rigid",
20+
"element_type": "minecraft:single_pool_element"
21+
}
1322
}
1423
]
1524
}

0 commit comments

Comments
 (0)