mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-01-31 19:16:44 +01:00
Set butterfly spawn conditions to include more blocks
This commit is contained in:
parent
2784627adc
commit
1503cb5773
3 changed files with 5 additions and 1 deletions
|
@ -83,6 +83,8 @@ public interface UTags {
|
|||
TagKey<Block> CLOUD_STAIRS = block("cloud_stairs");
|
||||
TagKey<Block> CLOUD_BLOCKS = block("cloud_blocks");
|
||||
TagKey<Block> CHITIN_BLOCKS = block("chitin_blocks");
|
||||
|
||||
TagKey<Block> BUTTERFLIES_SPAWNABLE_ON = block("butterflies_spawn_on");
|
||||
}
|
||||
|
||||
static TagKey<Item> item(String name) {
|
||||
|
|
|
@ -40,6 +40,7 @@ public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider {
|
|||
};
|
||||
|
||||
getOrCreateTagBuilder(UTags.CATAPULT_IMMUNE).add(Blocks.BEDROCK).forceAddTag(BlockTags.DOORS).forceAddTag(BlockTags.TRAPDOORS);
|
||||
getOrCreateTagBuilder(UTags.Blocks.BUTTERFLIES_SPAWNABLE_ON).forceAddTag(BlockTags.ANIMALS_SPAWNABLE_ON).forceAddTag(BlockTags.LEAVES).forceAddTag(BlockTags.FLOWERS).forceAddTag(BlockTags.FLOWER_POTS);
|
||||
getOrCreateTagBuilder(UTags.JARS).add(UBlocks.JAR, UBlocks.CLOUD_JAR, UBlocks.STORM_JAR, UBlocks.LIGHTNING_JAR, UBlocks.ZAP_JAR);
|
||||
getOrCreateTagBuilder(BlockTags.CROPS).add(crops);
|
||||
getOrCreateTagBuilder(BlockTags.BEE_GROWABLES).add(crops);
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.util.stream.Collectors;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.minelittlepony.unicopia.USounds;
|
||||
import com.minelittlepony.unicopia.UTags;
|
||||
import com.minelittlepony.unicopia.Unicopia;
|
||||
import com.minelittlepony.unicopia.item.ButterflyItem;
|
||||
import com.minelittlepony.unicopia.util.NbtSerialisable;
|
||||
|
@ -73,7 +74,7 @@ public class ButterflyEntity extends AmbientEntity {
|
|||
}
|
||||
|
||||
public static boolean canSpawn(EntityType<? extends ButterflyEntity> type, WorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
||||
return world.getBlockState(pos.down()).isIn(BlockTags.ANIMALS_SPAWNABLE_ON);
|
||||
return world.getBlockState(pos.down()).isIn(UTags.Blocks.BUTTERFLIES_SPAWNABLE_ON);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue